/* Simple Time Tracker — Frontend (dark) styles */

.stt-frontend-wrap {
	/* Break out of any theme content container to occupy the full viewport width.
	   `margin: 0 calc(50% - 50vw)` self-adjusts to wherever the parent sits —
	   works when the parent is centered, offset, in a flex/grid, or padded. */
	width: auto;
	max-width: none;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	box-sizing: border-box;
	background: #07090d;
	color: #d8e1f0;
	border: 0;
	border-radius: 0;
	padding: 28px;
	box-shadow: none;
	font-size: 14px;
	line-height: 1.45;
}

/* Prevent horizontal scrollbar on the page from the break-out margins. */
html:has(.stt-frontend-wrap),
body:has(.stt-frontend-wrap) {
	overflow-x: hidden;
}

.stt-frontend-wrap h1,
.stt-frontend-wrap h2,
.stt-frontend-wrap h3,
.stt-frontend-wrap h4 {
	color: #dbe5f7;
	margin-top: 0;
	letter-spacing: -.01em;
}

.stt-frontend-wrap h1 { font-size: 26px; }
.stt-frontend-wrap h2 { font-size: 20px; margin-bottom: 12px; }
.stt-frontend-wrap h3 { font-size: 16px; margin-bottom: 10px; }
.stt-frontend-wrap h4 { font-size: 14px; }

.stt-frontend-wrap p,
.stt-frontend-wrap label,
.stt-frontend-wrap span,
.stt-frontend-wrap li,
.stt-frontend-wrap td,
.stt-frontend-wrap th {
	color: #c3cede;
	font-size: 13px;
}

.stt-frontend-wrap .stt-item-row span {
	font-size: 13px;
	color: #c7d3e4;
}

/* Tabs */
.stt-frontend-wrap .stt-tab-btn {
	background: #131923;
	color: #b8c6da;
	border: 1px solid #2b3445;
	border-radius: 12px;
	padding: 9px 14px;
	transition: all .2s ease;
	font-size: 13px;
	font-weight: 500;
}

.stt-frontend-wrap .stt-tab-btn:hover {
	background: #18202c;
	border-color: #3b4860;
	color: #d7e2f3;
}

.stt-frontend-wrap .stt-tab-btn.active {
	background: linear-gradient(135deg, #5b8cff, #7a5cff);
	color: #ffffff;
	border-color: transparent;
	box-shadow: 0 8px 20px rgba(91, 140, 255, .28);
}

/* Boxes */
.stt-frontend-wrap .stt-items-box,
.stt-frontend-wrap .stt-assoc-col,
.stt-frontend-wrap .stt-edit-track-form {
	background: #11161f;
	border: 1px solid #283244;
	border-radius: 16px;
	padding: 18px;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02), 0 8px 24px rgba(0, 0, 0, .18);
}

/* Requester list */
.stt-frontend-wrap .stt-requester-list {
	background: #11161f;
	border: 1px solid #283244;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.stt-frontend-wrap .stt-requester-list li {
	border-bottom: 1px solid #1d2634;
}

.stt-frontend-wrap .stt-requester-list li:last-child {
	border-bottom: none;
}

.stt-frontend-wrap .stt-requester-list li button {
	color: #bfcde0;
	background: transparent;
	font-size: 13px;
}

.stt-frontend-wrap .stt-requester-list li.active button {
	background: linear-gradient(135deg, rgba(91, 140, 255, .16), rgba(122, 92, 255, .14));
	color: #e6eeff;
}

/* Form fields */
.stt-frontend-wrap input[type="text"],
.stt-frontend-wrap input[type="datetime-local"],
.stt-frontend-wrap textarea,
.stt-frontend-wrap select {
	width: 100%;
	background: #0d1219;
	color: #d8e1f0;
	border: 1px solid #2b3445;
	border-radius: 12px;
	padding: 10px 12px;
	box-sizing: border-box;
	outline: none;
	transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
	font-size: 13px;
}

.stt-frontend-wrap input[type="text"]::placeholder,
.stt-frontend-wrap textarea::placeholder {
	color: #7f8ca3;
}

.stt-frontend-wrap input[type="text"]:focus,
.stt-frontend-wrap input[type="datetime-local"]:focus,
.stt-frontend-wrap textarea:focus,
.stt-frontend-wrap select:focus {
	border-color: #5b8cff;
	box-shadow: 0 0 0 4px rgba(91, 140, 255, .14);
	background: #101721;
}

.stt-frontend-wrap textarea {
	min-height: 110px;
	resize: vertical;
}

/* Buttons */
.stt-frontend-wrap .button,
.stt-frontend-wrap button {
	background: #151b25;
	color: #d5dfef;
	border: 1px solid #313b4d;
	border-radius: 12px;
	padding: 9px 14px;
	cursor: pointer;
	transition: all .2s ease;
	font-size: 13px;
	font-weight: 500;
}

.stt-frontend-wrap .button:hover,
.stt-frontend-wrap button:hover {
	background: #1b2330;
	border-color: #43516a;
	transform: translateY(-1px);
}

.stt-frontend-wrap .button.button-primary,
.stt-frontend-wrap .stt-start-btn,
.stt-frontend-wrap .stt-save-links-btn,
.stt-frontend-wrap .stt-update-track-btn {
	background: linear-gradient(135deg, #5b8cff, #7a5cff);
	border: none;
	color: #ffffff;
	box-shadow: 0 10px 24px rgba(91, 140, 255, .22);
}

.stt-frontend-wrap .button.button-primary:hover,
.stt-frontend-wrap .stt-start-btn:hover,
.stt-frontend-wrap .stt-save-links-btn:hover,
.stt-frontend-wrap .stt-update-track-btn:hover {
	filter: brightness(1.05);
}

/* Item rows */
.stt-frontend-wrap .stt-item-row {
	border-bottom: 1px solid #1d2634;
}

/* Table */
.stt-frontend-wrap table.widefat {
	border-collapse: separate;
	border-spacing: 0;
	width: 100%;
	background: #11161f;
	border: 1px solid #283244;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.stt-frontend-wrap table.widefat thead th {
	background: #161d28;
	color: #d6e0f0;
	border-bottom: 1px solid #283244;
	padding: 11px 12px;
	font-size: 12px;
	font-weight: 600;
}

.stt-frontend-wrap table.widefat tbody td {
	background: #11161f;
	color: #bcc9dc;
	border-bottom: 1px solid #1d2634;
	padding: 11px 12px;
	font-size: 12px;
}

.stt-frontend-wrap table.widefat tbody tr:last-child td {
	border-bottom: none;
}

/* Misc */
.stt-frontend-wrap hr {
	border: 0;
	border-top: 1px solid #222c3b;
	margin: 24px 0;
}

.stt-frontend-wrap code {
	background: #151b25;
	color: #9fb8ea;
	padding: 2px 8px;
	border-radius: 8px;
}

.stt-frontend-wrap input[type="checkbox"] {
	accent-color: #6f95ff;
}

.stt-frontend-wrap .stt-checkbox-list {
	padding-right: 4px;
}

.stt-frontend-wrap .stt-checkbox-list::-webkit-scrollbar { width: 10px; }
.stt-frontend-wrap .stt-checkbox-list::-webkit-scrollbar-thumb { background: #313b4d; border-radius: 10px; }
.stt-frontend-wrap .stt-checkbox-list::-webkit-scrollbar-track { background: #0d1219; }

/* ---- Report (dark) ---- */

.stt-frontend-wrap .stt-report-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 14px;
	margin-bottom: 24px;
}

.stt-frontend-wrap .stt-report-card {
	background: #11161f;
	border: 1px solid #283244;
	border-radius: 16px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.stt-frontend-wrap .stt-report-card--accent {
	border-color: #5b8cff;
	background: linear-gradient(135deg, rgba(91,140,255,.1), rgba(122,92,255,.08));
}

.stt-frontend-wrap .stt-report-card__label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #7f8ca3;
}

.stt-frontend-wrap .stt-report-card__value {
	font-size: 26px;
	font-weight: 700;
	color: #dbe5f7;
	line-height: 1;
}

.stt-frontend-wrap .stt-report-card--accent .stt-report-card__value {
	color: #7aaaff;
}

.stt-frontend-wrap .stt-report-card__sub {
	font-size: 12px;
	color: #7f8ca3;
}

.stt-frontend-wrap .stt-report-breakdown {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 8px;
}

.stt-frontend-wrap .stt-report-table-wrap h3 {
	margin-top: 0;
	margin-bottom: 10px;
	color: #dbe5f7;
}

.stt-frontend-wrap .stt-report-table-wrap:last-child {
	grid-column: 1 / -1;
}

.stt-frontend-wrap .stt-pct-bar > div {
	background: linear-gradient(90deg, #5b8cff, #7a5cff);
	border-radius: 4px;
}

.stt-frontend-wrap .stt-pct-bar > span {
	color: #9fb8ea;
}

@media (max-width: 700px) {
	.stt-frontend-wrap .stt-report-breakdown {
		grid-template-columns: 1fr;
	}
	.stt-frontend-wrap .stt-report-table-wrap:last-child {
		grid-column: 1;
	}
}

/* ---------------------------------------------------------------
   Tabs — règles nécessaires sur le frontend
   (admin.css n'est pas toujours chargé hors contexte admin)
--------------------------------------------------------------- */
.stt-tab-panel {
	display: none;
}
.stt-tab-panel.active {
	display: block;
}

/* ── Presets (dark theme) ────────────────────────────────── */

.stt-frontend-wrap .stt-presets-block {
	background: #0f1420;
	border: 1px solid #1f2836;
}

.stt-frontend-wrap .stt-preset-chip {
	background: #131a26;
	border-color: #2b3445;
	box-shadow: none;
}

.stt-frontend-wrap .stt-preset-chip:hover {
	border-color: #4b8dd4;
	box-shadow: 0 2px 8px rgba(75, 141, 212, 0.25);
}

.stt-frontend-wrap .stt-preset-chip--invalid {
	border-color: #d97706;
	background: #2a1f0a;
}

.stt-frontend-wrap .stt-preset-chip--invalid:hover {
	border-color: #b45309;
}

.stt-frontend-wrap .stt-preset-invalid-badge {
	background: #3a2710;
	border-right-color: #5a3a10;
}

.stt-frontend-wrap .stt-preset-start:hover {
	background: #1a2333;
}

.stt-frontend-wrap .stt-preset-label {
	color: #dbe5f7;
}

.stt-frontend-wrap .stt-preset-meta {
	color: #7f8ca3;
}

.stt-frontend-wrap .stt-preset-delete {
	border-left-color: #2b3445;
	color: #e2574a;
}

.stt-frontend-wrap .stt-preset-delete:hover {
	background: #2a1616;
}

.stt-frontend-wrap .stt-preset-form {
	background: #0b1018;
	border-color: #2b3445;
}

/* ── Outlook meetings (dark theme) ───────────────────────── */

.stt-frontend-wrap .stt-outlook-block {
	background: #0d1524;
	border-color: #1f3050;
}

.stt-frontend-wrap .stt-meeting-row {
	background: #131a26;
	border-color: #2b3445;
}

.stt-frontend-wrap .stt-meeting-row.is-soon    { border-color: #d4a028; background: #201908; }
.stt-frontend-wrap .stt-meeting-row.is-running { border-color: #2b8f38; background: #0e2213; }

.stt-frontend-wrap .stt-meeting-day    { color: #7f8ca3; }
.stt-frontend-wrap .stt-meeting-hours  { color: #6fa9dd; }
.stt-frontend-wrap .stt-meeting-title  { color: #dbe5f7; }
.stt-frontend-wrap .stt-meeting-meta   { color: #7f8ca3; }
.stt-frontend-wrap .stt-meeting-mapping{ color: #6fa9dd; }

/* ── Track state highlighting (dark theme) ───────────────── */

.stt-frontend-wrap .stt-history-table tr.stt-track-running > td {
	background: #0e2213 !important;
	border-left-color: #46b450;
}

.stt-frontend-wrap .stt-history-table tr.stt-track-paused > td {
	background: #201908 !important;
	border-left-color: #d4a028;
}

.stt-frontend-wrap .stt-state-badge.stt-state-done {
	background: #1a2333;
	color: #7f8ca3;
}

/* ── Multi-day warning + modal (dark theme) ──────────────── */

.stt-frontend-wrap .stt-multiday-warning {
	background: #201908;
	border-color: #d4a028;
	border-left-color: #d68410;
}

.stt-frontend-wrap .stt-multiday-warning h3 { color: #f5c66b; }

.stt-frontend-wrap .stt-multiday-warning table { background: #131a26; }
.stt-frontend-wrap .stt-multiday-warning table td { color: #c3cede; }

/* Modal keeps its light background even inside the dark shortcode, so the form
   remains readable — no override needed. */

/* ── Timer-tab alert banner (dark) ───────────────────────── */

.stt-frontend-wrap .stt-alert-banner {
	background: #201908;
	border-color: #d4a028;
	border-left-color: #d68410;
	color: #f5c66b;
}

.stt-frontend-wrap .stt-alert-banner a { color: #ffbf5a; }
