/* MYDIB Espace — navigation par onglets */
.myws {
	--myws-ink: #2B1A12;
	--myws-mango: #F4661B;
	--myws-leaf: #0F7A52;
	--myws-cream: #FFF4E8;
	--myws-line: #EADBCB;
	--myws-muted: #7A6558;
	color: var(--myws-ink);
}

.myws.is-admin {
	margin: 12px 20px 0 2px;
}

.myws.is-front {
	max-width: 1280px;
	margin: 20px auto;
}

.myws-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px;
	margin-bottom: 12px;
	background: #fff;
	border: 1px solid var(--myws-line);
	border-radius: 12px;
	position: sticky;
	top: 32px;
	z-index: 20;
}

.myws.is-front .myws-bar {
	top: 0;
}

.myws-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--myws-ink);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.myws-tab:hover {
	background: var(--myws-cream);
}

.myws-tab[aria-selected="true"] {
	background: var(--myws-mango);
	color: #fff;
}

.myws-tab:focus-visible {
	outline: 2px solid var(--myws-mango);
	outline-offset: 2px;
}

.myws-badge {
	min-width: 18px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--myws-leaf);
	color: #fff;
	font-size: 11px;
	line-height: 18px;
	text-align: center;
}

.myws-tab[aria-selected="true"] .myws-badge {
	background: #fff;
	color: var(--myws-mango);
}

.myws-bar-end {
	margin-left: auto;
	display: flex;
	gap: 6px;
}

.myws-bar-end .myws-tab {
	font-weight: 500;
	color: var(--myws-muted);
}

.myws-panel[hidden] {
	display: none !important;
}

/* La boîte de réception occupe la hauteur restante. */
.myws .mwa-wrap {
	margin: 0;
}

.myws.is-admin .mwa-app {
	height: calc(100vh - 32px - 90px);
}

.myws.is-front .mwa-app {
	height: calc(100vh - 110px);
}

/* Commandes */
.myws .md-order-app {
	margin: 0 auto 16px;
}

.myws-card {
	max-width: 920px;
	margin: 0 auto 16px;
	padding: 16px 24px 20px;
	background: #fff;
	border: 1px solid var(--myws-line);
	border-radius: 16px;
}

.myws-card h3 {
	margin: 4px 0 12px;
}

.myws-kv {
	margin-bottom: 12px;
	border-collapse: collapse;
}

.myws-kv th {
	padding: 4px 16px 4px 0;
	text-align: left;
	color: var(--myws-muted);
	font-weight: 600;
	vertical-align: top;
}

.myws-kv td {
	padding: 4px 0;
	word-break: break-all;
}

.myws-scroll {
	overflow-x: auto;
	max-height: 420px;
}

/* Campagnes */
.myws-camp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.myws-camp-table th,
.myws-camp-table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--myws-line);
	text-align: left;
	vertical-align: middle;
}

.myws-camp-table th {
	color: var(--myws-muted);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.myws-camp-table td.is-num {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.myws-camp-name {
	padding: 0;
	border: 0;
	background: none;
	color: var(--myws-leaf);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-align: left;
}

.myws-camp-name:hover {
	text-decoration: underline;
}

.myws-code {
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--myws-cream);
	font-family: monospace;
	font-size: 12px;
}

.myws-copy {
	padding: 5px 10px;
	border: 1px solid var(--myws-line);
	border-radius: 6px;
	background: #fff;
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}

.myws-copy:hover {
	border-color: var(--myws-mango);
}

.myws-muted {
	color: var(--myws-muted);
	font-size: 13px;
}

.myws-legend {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.myws-legend li {
	padding: 10px 12px;
	border: 1px solid var(--myws-line);
	border-radius: 10px;
	font-size: 13px;
}

.myws-legend strong {
	display: block;
}

@media (max-width: 782px) {
	.myws.is-admin {
		margin: 10px 10px 0 0;
	}
	.myws-bar {
		top: 46px;
		overflow-x: auto;
	}
	.myws-tab {
		padding: 8px 12px;
	}
	.myws-bar-end {
		display: none;
	}
	.myws.is-admin .mwa-app,
	.myws.is-front .mwa-app {
		height: calc(100vh - 46px - 90px);
	}
	.myws-camp-table .is-hide-sm {
		display: none;
	}
}

/* ---------- Page plein écran (site) ---------- */

body.myws-app-page {
	margin: 0 !important;
	padding: 0 !important;
	background: #f4f6fb !important;
	overflow-x: hidden;
}

.myws-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 52px;
	padding: 0 20px;
	background: #fff;
	border-bottom: 1px solid #e8e8e8;
}

.myws-top-brand {
	font-family: 'Fredoka One', 'Nunito Sans', sans-serif;
	font-size: 20px;
	color: #1d3461 !important;
	text-decoration: none !important;
	white-space: nowrap;
}

.myws-top-brand span {
	font-family: 'Nunito Sans', sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: #5b6b85;
}

.myws-top-links {
	display: flex;
	align-items: center;
	gap: 18px;
	font-family: 'Nunito Sans', sans-serif;
	font-size: 14px;
	font-weight: 700;
}

.myws-top-links a {
	color: #1d3461 !important;
	text-decoration: none !important;
}

.myws-top-links a:hover {
	color: #e09a00 !important;
}

.myws-top-user {
	color: #5b6b85;
}

.myws-main {
	padding: 12px 16px 16px;
}

.myws-app-page .myws.is-front {
	max-width: none;
	margin: 0;
}

.myws-app-page .myws.is-front .myws-bar {
	top: 8px;
}

.myws-app-page .myws.is-front .mwa-app {
	height: calc(100vh - 52px - 28px - 64px);
	min-height: 480px;
}

.myws-app-page .md-login-card {
	margin-top: 60px;
}

/* Page non plein écran : on sort de la colonne étroite du thème. */
body:not(.myws-app-page) .myws.is-front {
	width: min(1360px, calc(100vw - 40px));
	max-width: none;
	margin-left: calc(50% - min(680px, 50vw - 20px));
	margin-right: 0;
}

@media (max-width: 782px) {
	.myws-top-user,
	.myws-top-brand span {
		display: none;
	}
	.myws-main {
		padding: 8px;
	}
	.myws-app-page .myws.is-front .mwa-app {
		height: calc(100vh - 52px - 16px - 60px);
	}
}
