/* =============================================================
   Admin Portal CSS — ported from App/wwwroot/css/GeneralCSS/site.css
   ============================================================= */

/* ---- Tokens ---- */
:root {
	--white: #FFFFFF;
	--black: #000000;
	--success: #069569;
	--warning: #FFEDD1;
	--warning-dark: #5c3d0d;
	--danger: #D90000;
	--danger-bg: #FEE;
	--off-black: #353434;
	--grey-dark: #535353;
	--grey: #B5B5B5;
	--grey-light: #E3E3E3;
	--grey-off-white: #F2F2F2;
	--accent-light: #FCFFDD;
	--accent: #E9F848;
	--accent-dark: #C6D243;
	--primary-off-white: #F5FFFF;
	--primary-xlight: #E1F4F4;
	--primary-light: #D3FDFD;
	--primary: #009B96;
	--primary-dark: #068080;
	--g_medium_txt: #727b8b;
	--tab_grey_txt: #727b8b;
	--light_grey_tab_bg: #f9fafa;
	--box_shadow: 0px 1px 9px -4px var(--grey);
	--box_shadow_hover: 0px 1px 9px -4px var(--tab_grey_txt);
	--bg_lg: #f5f6f6;
	--input-bg: #ffffff;
	--input-border: #E3E3E3;
}

:root.theme-dark {
	--white:            #1f2226;
	--bg_lg:            #15171a;
	--grey-off-white:   #26292e;
	--light_grey_tab_bg:#1f2226;
	--grey-light:       #3a3e44;
	--grey:             #5a5f66;
	--off-black:        #e8eaed;
	--grey-dark:        #b8bcc2;
	--g_medium_txt:     #9da3ad;
	--tab_grey_txt:     #9da3ad;
	--primary-off-white:#1a2a2a;
	--primary-xlight:   #103535;
	--primary-light:    #114545;
	--primary:          #1abab5;
	--primary-dark:     #46d8d3;
	--accent-light:     #2a2c10;
	--accent:           #9aa726;
	--accent-dark:      #6b7a18;
	--success:          #1cb37e;
	--warning:          #4a3814;
	--warning-dark:     #f0c97a;
	--danger:           #ff5d5d;
	--danger-bg:        #3a0a0a;
	--input-bg:         #2a2e34;
	--input-border:     #5a6068;
}

/* Smooth color-variable swap on theme toggle — applies for all users. */
body, body * {
	transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease;
}

/* Body background takes a longer multi-stage fade during a deliberate theme toggle.
   Gated by .theme-transitioning (added by JS on click, removed after 2s) so the
   animation does not run on initial page load. */
@keyframes admin-bg-fade-to-light {
	0%   { background-color: #1f2226; }
	35%  { background-color: #4a4e54; }
	70%  { background-color: #a9adb2; }
	100% { background-color: #FFFFFF; }
}
@keyframes admin-bg-fade-to-dark {
	0%   { background-color: #FFFFFF; }
	35%  { background-color: #a9adb2; }
	70%  { background-color: #4a4e54; }
	100% { background-color: #1f2226; }
}
:root:not(.theme-dark) body.theme-transitioning {
	animation: admin-bg-fade-to-light 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}
:root.theme-dark body.theme-transitioning {
	animation: admin-bg-fade-to-dark 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---- Resets ---- */
body {
	max-width: 100vw;
	margin: 0;
	padding: 0;
	height: 100vh;
	background-color: var(--white);
	overflow-x: hidden;
	overflow-y: auto;
	position: relative;
}

body button,
body input,
body a {
	transition: border 0.3s ease-in, color 0.3s ease-in, background 0.3s ease-in, transform 0.3s ease-in;
}

button:hover,
a:hover,
select:hover {
	cursor: pointer;
}

* {
	font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-weight: 400;
	line-height: 1.2;
	box-sizing: border-box;
	font-size: 13px;
	color: var(--grey-dark);
	accent-color: var(--primary);
}

::selection {
	background-color: var(--primary-dark);
	color: white;
}

::-moz-selection {
	background-color: var(--primary-dark);
	color: white;
}

::-webkit-scrollbar {
	width: 6px;
	height: 3px;
	border-radius: 5px;
}

::-webkit-scrollbar-track {
	background: var(--grey-light) !important;
	border-radius: 5px;
}

::-webkit-scrollbar-thumb {
	background: var(--grey) !important;
	border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--grey-dark) !important;
	cursor: pointer;
}

/* ---- Visibility ---- */
.dispnoneclass { display: none !important; }
.dispBlock     { display: block; }
.noscroll      { overflow-y: hidden !important; }
.nostyle {
	background-color: transparent;
	outline: none;
	border: 0px solid transparent;
}
button.nostyle { min-width: 26px; min-height: 26px; }
.whitespacenowrap { white-space: nowrap; }

/* ---- Gap ---- */
.G8  { gap: 8px; }
.G12 { gap: 12px; }
.G16 { gap: 16px; }
.G24 { gap: 24px; }
.G32 { gap: 32px; }
.G64 { gap: 64px; }
.gap5  { gap: 5px; }
.gap15 { gap: 15px; }
.gap50 { gap: 50px; }

/* ---- Padding ---- */
.PL4  { padding-left: 4px; }    .PR4  { padding-right: 4px; }    .PT4  { padding-top: 4px; }    .PB4  { padding-bottom: 4px; }
.PL8  { padding-left: 8px; }    .PR8  { padding-right: 8px; }    .PT8  { padding-top: 8px; }    .PB8  { padding-bottom: 8px; }
.PL12 { padding-left: 12px; }   .PR12 { padding-right: 12px; }   .PT12 { padding-top: 12px; }   .PB12 { padding-bottom: 12px; }
.PL16 { padding-left: 16px; }   .PR16 { padding-right: 16px; }   .PT16 { padding-top: 16px; }   .PB16 { padding-bottom: 16px; }
.PL24 { padding-left: 24px; }   .PR24 { padding-right: 24px; }   .PT24 { padding-top: 24px; }   .PB24 { padding-bottom: 24px; }
.PL32 { padding-left: 32px; }   .PR32 { padding-right: 32px; }   .PT32 { padding-top: 32px; }   .PB32 { padding-bottom: 32px; }
.PL64 { padding-left: 64px; }   .PR64 { padding-right: 64px; }   .PT64 { padding-top: 64px; }   .PB64 { padding-bottom: 64px; }
.PTB4  { padding-top: 4px;  padding-bottom: 4px; }   .PLR4  { padding-left: 4px;  padding-right: 4px; }
.PTB8  { padding-top: 8px;  padding-bottom: 8px; }   .PLR8  { padding-left: 8px;  padding-right: 8px; }
.PTB12 { padding-top: 12px; padding-bottom: 12px; }  .PLR12 { padding-left: 12px; padding-right: 12px; }
.PTB16 { padding-top: 16px; padding-bottom: 16px; }  .PLR16 { padding-left: 16px; padding-right: 16px; }
.PTB24 { padding-top: 24px; padding-bottom: 24px; }  .PLR24 { padding-left: 24px; padding-right: 24px; }
.PTB32 { padding-top: 32px; padding-bottom: 32px; }  .PLR32 { padding-left: 32px; padding-right: 32px; }
.PTB64 { padding-top: 64px; padding-bottom: 64px; }  .PLR64 { padding-left: 64px; padding-right: 64px; }
.padtb10 { padding: 10px 0; }
.pad10   { padding: 10px; }

/* ---- Margin ---- */
.ML8  { margin-left: 8px; }    .MR8  { margin-right: 8px; }    .MT8  { margin-top: 8px; }    .MB8  { margin-bottom: 8px; }    .MB4 { margin-bottom: 4px; }
.ML12 { margin-left: 12px; }   .MR12 { margin-right: 12px; }   .MT12 { margin-top: 12px; }   .MB12 { margin-bottom: 12px; }
.ML16 { margin-left: 16px; }   .MR16 { margin-right: 16px; }   .MT16 { margin-top: 16px; }   .MB16 { margin-bottom: 16px; }
.ML24 { margin-left: 24px; }   .MR24 { margin-right: 24px; }   .MT24 { margin-top: 24px; }   .MB24 { margin-bottom: 24px; }
.ML32 { margin-left: 32px; }   .MR32 { margin-right: 32px; }   .MT32 { margin-top: 32px; }   .MB32 { margin-bottom: 32px; }
.ML64 { margin-left: 64px; }   .MR64 { margin-right: 64px; }   .MT64 { margin-top: 64px; }   .MB64 { margin-bottom: 64px; }
.MTB8  { margin-top: 8px;  margin-bottom: 8px; }   .MLR8  { margin-left: 8px;  margin-right: 8px; }
.MTB12 { margin-top: 12px; margin-bottom: 12px; }  .MLR12 { margin-left: 12px; margin-right: 12px; }
.MTB16 { margin-top: 16px; margin-bottom: 16px; }  .MLR16 { margin-left: 16px; margin-right: 16px; }
.MTB24 { margin-top: 24px; margin-bottom: 24px; }  .MLR24 { margin-left: 24px; margin-right: 24px; }
.MTB32 { margin-top: 32px; margin-bottom: 32px; }  .MLR32 { margin-left: 32px; margin-right: 32px; }
.MTB64 { margin-top: 64px; margin-bottom: 64px; }  .MLR64 { margin-left: 64px; margin-right: 64px; }

/* ---- Width ---- */
.W_Fit { width: fit-content; }
.W5  { width: 5%; }    .W10 { width: 10%; }   .W15 { width: 15%; }   .W20 { width: 20%; }
.W25 { width: 25%; }   .W30 { width: 30%; }   .W35 { width: 35%; }   .W40 { width: 40%; }
.W45 { width: 45%; }   .W50 { width: 50%; }   .W55 { width: 55%; }   .W60 { width: 60%; }
.W65 { width: 65%; }   .W70 { width: 70%; }   .W75 { width: 75%; }   .W80 { width: 80%; }
.W85 { width: 85%; }   .W90 { width: 90%; }   .W95 { width: 95%; }   .W100 { width: 100%; }
.minW50  { min-width: 50px  !important; }
.minW70  { min-width: 70px  !important; }
.minW100 { min-width: 100px !important; }
.minW120 { min-width: 120px !important; }
.minW150 { min-width: 150px !important; }
.minW170 { min-width: 170px !important; }
.minW190 { min-width: 190px !important; }
.minW220 { min-width: 220px !important; }
.minW280 { min-width: 280px !important; }
.minW320 { min-width: 320px !important; }
.minW380 { min-width: 380px !important; }
.minW420 { min-width: 420px !important; }

/* ---- Font size / weight ---- */
.FS13 { font-size: 13px; }
.FS14 { font-size: 14px; }
.FS15 { font-size: 15px; }
.FS16 { font-size: 16px; }
.FW600 { font-weight: 600; }

/* ---- Text / justify ---- */
.txt-center { text-align: center; }
.txt-left   { text-align: left; }
.txt-right  { text-align: right; }
.jsc-between { justify-content: space-between !important; }
.jsc-end     { justify-content: end; }
.jsc-center  { justify-content: center; }
.jss-center  { justify-self: center; }
.jss-end     { justify-self: end; }
.jss-start   { justify-self: start; }
.aligncenter { align-items: center; }

/* ---- Flex / containers ---- */
.containerflex { display: flex; }
.colp  { color: var(--primary); }
.colpd { color: var(--primary-dark); }
.colg  { color: var(--g_medium_txt); }
.hrefprimary {
	color: var(--primary);
	cursor: pointer;
}
.hrefprimary:hover { color: var(--primary-dark); }

/* ---- Animations ---- */
@keyframes fadeInOut {
	0%   { opacity: 1; }
	20%  { opacity: 0.66; }
	40%  { opacity: 0.33; }
	60%  { opacity: 0; }
	80%  { opacity: 0.33; }
	100% { opacity: 0.66; }
}

/* ============================================================= */
/* Buttons                                                       */
/* ============================================================= */
.btn {
	padding: 6px 30px;
	border-radius: 5px;
	outline: none;
	font-weight: 400;
	font-size: 14px;
	text-wrap: nowrap;
	height: 32px;
}
.btn_small {
	padding: 5px 15px !important;
	font-size: 13px !important;
	border-radius: 3px;
	line-height: 1;
	height: fit-content;
}
button.btn.btn_pill, a.btn.btn_pill { border-radius: 18px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
a.btn { text-decoration: none; text-align: center; }
a.btn:hover { cursor: pointer; }

.btn_primary       { border: 1px solid var(--primary);        background-color: var(--primary);        color: var(--white); }
.btn_primaryinv    { border: 1px solid var(--primary);        background-color: var(--white);          color: var(--primary); }
.btn_primarylight  { border: 1px solid var(--primary-xlight); background-color: var(--primary-xlight); color: var(--primary-dark); }
.btn_accent        { border: 1px solid var(--accent);         background-color: var(--accent);         color: var(--grey-dark); }
.btn_accentinv     { border: 1px solid var(--accent-dark);    background-color: var(--white);          color: var(--accent-dark); }
.btn_accentlight   { border: 1px solid var(--accent-light);   background-color: var(--accent-light);   color: var(--accent-dark); }
.btn_darkgray      { border: 1px solid var(--grey-light);     background-color: var(--grey-light);     color: var(--grey-dark); }
.btn_darkgrayinv   { border: 1px solid var(--grey);           background-color: var(--white);          color: var(--g_medium_txt); }
.btn_offwhite      { border: 1px solid var(--grey-off-white); background-color: var(--grey-off-white); color: var(--grey); }
.btn_danger        { border: 1px solid var(--danger);         background-color: var(--danger);         color: var(--white); }
.btn_dangerinv     { border: 1px solid var(--danger);         background-color: var(--white);          color: var(--danger); }
.btn_warning       { border: 1px solid var(--warning);        background-color: var(--warning);        color: var(--danger); }

/* ============================================================= */
/* Inputs                                                         */
/* ============================================================= */
.container_inp {
	display: flex;
	flex-wrap: nowrap;
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 5px;
	padding: 1px;
	width: 100%;
}
.container_inp:focus-within { border: 1px solid var(--primary-xlight); }

.inp {
	height: fit-content;
	border: 1px solid var(--input-border);
	background-color: var(--input-bg);
	color: var(--off-black);
	padding: 7px 14px;
	outline: none;
	width: 100%;
	min-height: 32px;
	border-radius: 5px;
}
.inp:hover { border: 1px solid var(--primary-light); }
.inp:focus { border: 1px solid var(--grey); }
.inp::placeholder { color: var(--grey); opacity: 1; }
input.disabled,
input[type="number"]:disabled,
select:disabled {
	background-color: var(--grey-off-white);
	color: var(--grey);
	border-color: #ccc;
	cursor: not-allowed;
}

/* ============================================================= */
/* Pagination                                                     */
/* ============================================================= */
.paginationcontainer {
	display: flex;
	width: 100%;
	margin: 20px auto;
	justify-content: center;
	gap: 5px;
}
.paginationcontainer label {
	color: var(--primary);
	font-size: 14px;
}
.paginationcontainer button {
	background-color: var(--white);
	outline: none;
	border: 1px solid var(--grey-dark);
	height: 25px;
	width: 25px;
	display: flex;
	justify-content: center;
	align-items: center;
}
.paginationcontainer button:hover { border: 1px solid var(--grey); }
.paginationcontainer div {
	background-color: var(--white);
	outline: none;
	border: 1px solid var(--grey-dark);
	height: 25px;
	width: 25px;
	display: flex;
	justify-content: center;
	align-items: center;
	color: var(--primary);
}
.raduisR { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.raduisL { border-top-left-radius:  5px; border-bottom-left-radius:  5px; }

/* ============================================================= */
/* Modal                                                          */
/* ============================================================= */
.modal {
	min-width: 280px;
	width: 80svw;
	border: 1px solid var(--grey-light);
	border-radius: 10px;
	z-index: 100000;
	position: fixed;
	top: 120px;
	max-width: 600px;
	left: 0;
	right: 0;
	display: block;
	margin: auto;
	background-color: var(--white);
}
.modal.modal_wide2 {
	width: 70vw;
	min-width: 280px;
	border-radius: 5px;
	z-index: 1000;
	max-width: none;
}
.modal.modal_wide {
	width: 60vw;
	min-width: 280px;
	border-radius: 5px;
	z-index: 1000;
	max-width: none;
}
.modal.modal_semi_wide {
	width: 55vw;
	min-width: 280px;
	max-width: 900px !important;
	border-radius: 5px;
	z-index: 1000;
}
.modal.modal_auto    { width: clamp(280px, 45svw, 700px) !important; min-width: auto; max-width: none !important; }
.modal.modal_auto_S  { width: clamp(280px, 45svw, 500px) !important; min-width: auto; max-width: none !important; }
.modal.modal_large_dense {
	top: 24px !important;
	width: 75vw;
	min-width: 280px;
	border-radius: 5px;
	z-index: 1000;
	max-width: none;
}
.modal.modal_large_dense .modal_body {
	max-height: calc(100svh - 170px);
	padding: 28px 56px;
}
.modal.modal_overflow .modal_body {
	min-height: 220px;
	max-height: calc(100svh - 200px);
	height: auto;
	overflow: visible;
	padding: 28px;
	border-bottom: 1px solid var(--grey-light);
	background-color: var(--white);
}

.modal_container {
	padding: 16px 28px;
	display: flex;
	width: 100%;
	align-items: center;
	border-bottom: 1px solid var(--grey-light);
}
.modal_body {
	min-height: 210px;
	max-height: calc(100svh - 200px);
	height: auto;
	overflow: auto;
	padding: 28px;
	border-bottom: 1px solid var(--grey-light);
	background-color: var(--white);
}
.modal_title {
	font-size: 20px;
	color: var(--primary);
}
.modal_close_btn {
	margin: auto 0 auto auto;
	background-color: transparent;
	border: none;
	outline: none;
	color: var(--grey);
	font-size: 19px;
	font-weight: 600;
}
.modal_close_btn:hover { color: var(--grey-dark); }
.modal_footer {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: right;
	gap: 10px;
	padding: 15px;
	background-color: var(--white);
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
}
.modal_footer button.btnmodalclose {
	border: 1px solid var(--grey);
	background-color: var(--white);
	color: var(--grey-dark);
	border-radius: 5px;
	outline: none;
	margin: auto auto auto 0;
}

#overlay {
	display: none;
	width: 100vw;
	height: 100vh;
	position: fixed;
	background-color: #00000029;
	z-index: 1002;
	top: 0;
}
#modal {
	display: none;
	z-index: 1004;
	top: 50px;
}

/* ============================================================= */
/* Prompt User                                                    */
/* ============================================================= */
.prompt_backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.04);
	display: flex;
	align-items: start;
	padding-top: 10%;
	justify-content: center;
	z-index: 10002;
}
.prompt_modal {
	background: var(--white);
	border-radius: 6px;
	min-width: 300px;
	width: fit-content;
	max-width: 430px;
	padding: 32px;
	box-shadow: 3px 8px 20px -10px var(--grey-light);
}
.prompt_message {
	margin-bottom: 24px;
	font-size: 13px;
	text-align: left;
	color: var(--grey-dark);
	line-height: 1.4;
}
.prompt_buttons {
	display: flex;
	justify-content: end;
	gap: 16px;
}
.prompt_button[data-value='true']:focus {
	outline: 2px solid royalblue;
	outline-offset: 1px;
}

/* ============================================================= */
/* Top Level Popup                                                */
/* ============================================================= */
#TopLevelOverlay {
	z-index: 10000;
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: transparent;
	backdrop-filter: blur(0.5px);
	-webkit-backdrop-filter: blur(0.5px);
}
#TopLevelModal {
	z-index: 10001;
	width: fit-content;
	min-width: 220px;
	max-width: 600px;
	background-color: var(--white);
	border-radius: 5px;
	min-height: fit-content;
	height: 280px;
	max-height: 680px;
	position: fixed;
	box-shadow: 0 0 17px -1px var(--grey);
	border: 1px solid var(--grey-light);
	top: 150px;
	justify-self: center;
}
.TopLevelHeader,
.TopLevelBody,
.TopLevelFooter {
	padding: 0 12px;
	width: 100%;
}
.TopLevelHeader,
.TopLevelFooter {
	display: flex;
	align-items: center;
}
.TopLevelHeader {
	border-bottom: 1px solid var(--grey-light);
	justify-content: space-between;
	height: 40px;
	position: relative;
}
.TopLevelFooter {
	border-top: 1px solid var(--grey-light);
	justify-content: flex-end;
	gap: 12px;
	height: 50px;
}
.TopLevelFooter .TopLevelCloseBtn {
	margin: auto auto auto 0;
	color: var(--grey-dark);
	background-color: var(--white);
	border: 1px solid var(--grey);
}
.TopLevelBody {
	min-height: calc(100% - 64px);
	height: auto;
	max-height: calc(65svh - 64px);
	overflow-y: scroll;
	padding: 24px 32px;
}
.TopLevelClose { font-size: 14px; font-weight: 600; }
.TopLevelTitle { color: var(--primary-dark); font-weight: 600; }
.dragitem {
	position: absolute;
	left: 50%;
	right: 50%;
	height: 10px;
	width: 10px;
	transform: translate(-50%, -50%);
	cursor: move;
	top: 4px;
}

/* ============================================================= */
/* Tab system                                                     */
/* ============================================================= */
.tab_invalid { position: relative; }
.tab_invalid::after {
	content: '';
	position: absolute;
	top: 50%;
	right: -3px;
	transform: translateY(calc(-50% - 2px));
	width: 5px;
	height: 5px;
	background-color: var(--danger);
	border-radius: 50%;
	animation: fadeInOut 1.4s infinite;
}
.tab_valid { position: relative; }
.tab_valid::after {
	content: '';
	position: absolute;
	top: 50%;
	right: -3px;
	transform: translateY(calc(-50% - 2px));
	width: 5px;
	height: 5px;
	background-color: var(--success);
	border-radius: 50%;
}

.tab_content_wrapper {
	container-type: inline-size;
	container-name: tabWrapper;
}
.tab_content_wrapper:not(.nostyle) {
	padding: 24px 40px;
	height: auto;
}
.tab_content_wrapper button:hover:not(:disabled):not(.card_expander_button) {
	transform: translateY(-1px);
}
.tab_content_wrapper .generic_tab_content { width: 100%; }

.tab_buttons_container .tab_button,
.tab_content_wrapper .tab_buttons_container .tab_button {
	outline: none;
	background-color: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 8px;
	white-space: nowrap;
	font-size: 13px;
	color: var(--tab_grey_txt);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	gap: 6px;
}
.tab_content_wrapper .tab_buttons_container .tab_button[data-open='true'] {
	border-bottom: 2px solid var(--primary);
	color: var(--primary-dark);
}
.tab_content_wrapper .tab_buttons_container .tab_button:not([data-open='true']):hover {
	border-bottom: 2px solid var(--grey-light);
}

/* ============================================================= */
/* Admin Portal — shell layout                                    */
/* ============================================================= */
.tab_content_wrapper#admin_app_root {
	display: grid;
	grid-template-columns: 240px 1fr;
	grid-template-areas: "sidebar content";
	gap: 0;
	padding: 0;
	min-height: 100vh;
	width: 100%;
}

/* Topbar (mobile only) */
.tab_content_wrapper#admin_app_root .admin_topbar {
	display: none;
	grid-area: topbar;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	background-color: var(--white);
	border-bottom: 1px solid var(--grey-light);
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin_topbar_title {
	font-size: 15px;
	font-weight: 600;
	color: var(--primary-dark);
}
.admin_theme_toggle {
	margin-left: auto;
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: transparent;
	border: 1px solid var(--grey-light);
	border-radius: 5px;
	color: var(--off-black);
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
}
.admin_theme_toggle:hover { border-color: var(--primary); color: var(--primary); }
.admin_menu_toggle {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 36px;
	height: 36px;
	padding: 8px;
	background-color: transparent;
	border: 1px solid var(--grey-light);
	border-radius: 5px;
	cursor: pointer;
}
.admin_menu_toggle span {
	display: block;
	height: 2px;
	width: 100%;
	background-color: var(--grey-dark);
	border-radius: 2px;
}

/* Backdrop (mobile only) */
.tab_content_wrapper#admin_app_root .admin_backdrop {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.4);
	z-index: 60;
}

/* Sidebar */
.tab_content_wrapper#admin_app_root .admin_sidebar {
	grid-area: sidebar;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	padding: 16px 0;
	background-color: var(--light_grey_tab_bg);
	border-right: 1px solid var(--grey-light);
	border-bottom: none;
	width: 240px;
	margin: 0;
	height: 100vh;
	position: sticky;
	top: 0;
	overflow-y: auto;
	grid-template-columns: none;
	grid-template-areas: none;
}
.admin_sidebar_brand_row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 20px 4px;
}
.admin_sidebar_brand_logo {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	flex-shrink: 0;
}
.admin_sidebar_brand_label {
	font-size: 16px;
	font-weight: 600;
	color: var(--primary-dark);
}
.admin_user_email {
	padding: 2px 20px 18px;
	font-size: 11px;
	color: var(--grey);
	border-bottom: 1px solid var(--grey-light);
	margin-bottom: 8px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tab_content_wrapper#admin_app_root .admin_sidebar .tab_button {
	border-bottom: none;
	border-left: 2px solid transparent;
	justify-content: flex-start;
	padding: 10px 20px;
	width: 100%;
	font-size: 13px;
	color: var(--tab_grey_txt);
	text-align: left;
}
.tab_content_wrapper#admin_app_root .admin_sidebar .tab_button[data-open='true'] {
	border-bottom: none;
	border-left: 2px solid var(--primary);
	background-color: var(--primary-off-white);
	color: var(--primary-dark);
	font-weight: 600;
}
.tab_content_wrapper#admin_app_root .admin_sidebar .tab_button:not([data-open='true']):hover {
	border-bottom: none;
	border-left: 2px solid var(--grey-light);
	background-color: var(--grey-off-white);
}
.tab_content_wrapper#admin_app_root .admin_sidebar .admin_external_link {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	width: 100%;
	padding: 10px 20px;
	border-left: 2px solid transparent;
	font-size: 13px;
	color: var(--tab_grey_txt);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}
.tab_content_wrapper#admin_app_root .admin_sidebar .admin_external_link:hover {
	border-left: 2px solid var(--grey-light);
	background-color: var(--grey-off-white);
}
.admin_sidebar_group {
	padding: 16px 20px 5px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--grey-dark);
}
.admin_profile_btn {
	margin: 0 16px 8px;
	padding: 8px 16px;
	background-color: transparent;
	border: 1px solid var(--grey-light);
	border-radius: 5px;
	font-size: 12px;
	color: var(--grey-dark);
	cursor: pointer;
}
.admin_profile_btn:hover {
	border-color: var(--primary);
	color: var(--primary);
}
.admin_logout_btn {
	margin: auto 16px 16px;
	padding: 8px 16px;
	background-color: transparent;
	border: 1px solid var(--grey-light);
	border-radius: 5px;
	font-size: 12px;
	color: var(--grey-dark);
	cursor: pointer;
}
.admin_logout_btn:hover {
	border-color: var(--danger);
	color: var(--danger);
}

/* Content */
.tab_content_wrapper#admin_app_root .admin_content_area {
	grid-area: content;
	padding: 24px 32px;
	overflow-y: auto;
	width: 100%;
	max-width: 100%;
}

/* ---- Tablet ---- */
@media (max-width: 1024px) {
	.tab_content_wrapper#admin_app_root {
		grid-template-columns: 200px 1fr;
	}
	.tab_content_wrapper#admin_app_root .admin_sidebar {
		width: 200px;
	}
	.tab_content_wrapper#admin_app_root .admin_content_area {
		padding: 20px 20px;
	}
}

/* ---- Mobile ---- */
@media (max-width: 767px) {
	.tab_content_wrapper#admin_app_root {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
		grid-template-areas:
			"topbar"
			"content";
	}
	.tab_content_wrapper#admin_app_root .admin_topbar {
		display: flex;
	}
	.tab_content_wrapper#admin_app_root .admin_sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 260px;
		max-width: 80vw;
		z-index: 70;
		transform: translateX(-100%);
		transition: transform 0.25s ease-out;
		height: 100vh;
	}
	.tab_content_wrapper#admin_app_root .admin_sidebar.is_open {
		transform: translateX(0);
		box-shadow: 3px 0 12px -4px var(--grey);
	}
	.tab_content_wrapper#admin_app_root .admin_content_area {
		grid-area: content;
		padding: 16px;
	}
}

/* ============================================================= */
/* Root sizing                                                    */
/* ============================================================= */
html, body { min-height: 100vh; }

/* ============================================================= */
/* Auth pages                                                     */
/* ============================================================= */
.auth_page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background-color: var(--bg_lg);
}
.auth_form {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	max-width: 360px;
	padding: 32px;
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 8px;
	box-shadow: var(--box_shadow);
}
.auth_logo {
	display: block;
	height: 56px;
	width: auto;
	max-width: 80%;
	margin: 0 auto 4px;
}
.auth_form h1 {
	margin: 0 0 8px 0;
	font-size: 20px;
	color: var(--primary-dark);
	text-align: center;
}
.auth_form label {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.auth_form label span {
	font-size: 12px;
	color: var(--grey-dark);
}
.auth_form input {
	padding: 8px 12px;
	border: 1px solid var(--grey-light);
	border-radius: 5px;
	outline: none;
	font-size: 14px;
}
.auth_form input:focus { border: 1px solid var(--primary); }
.auth_form button[type="submit"] {
	margin-top: 8px;
	padding: 10px;
	background-color: var(--primary);
	color: var(--white);
	border: 1px solid var(--primary);
	border-radius: 5px;
	outline: none;
	font-size: 14px;
	cursor: pointer;
}
.auth_form button[type="submit"]:hover { background-color: var(--primary-dark); }
.auth_card_link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-top: 8px;
	padding: 14px 16px;
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 8px;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.auth_card_link:hover { background-color: var(--primary-off-white); border-color: var(--primary); }
.auth_card_link_title { font-size: 14px; font-weight: 600; color: var(--primary-dark); }
.auth_card_link_sub   { font-size: 12px; font-weight: 400; color: var(--grey-dark); }
.auth_link {
	font-size: 12px;
	color: var(--primary);
	text-align: center;
	text-decoration: none;
}
.auth_link:hover { color: var(--primary-dark); }
.auth_error,
.auth_message {
	padding: 8px 12px;
	border-radius: 5px;
	font-size: 12px;
	text-align: center;
}
.auth_error   { background-color: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.auth_message { background-color: var(--primary-xlight); color: var(--primary-dark); }

@media (max-width: 480px) {
	.auth_page  { padding: 16px; align-items: flex-start; padding-top: 32px; }
	.auth_form  { padding: 24px 20px; max-width: 100%; box-shadow: none; border-radius: 6px; }
	.auth_form h1 { font-size: 18px; }
	.auth_form input { font-size: 16px; padding: 10px 12px; }
	.auth_form button[type="submit"] { font-size: 15px; padding: 12px; }
}

/* ============================================================= */
/* Module shared building blocks                                  */
/* ============================================================= */
.module_header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--grey-light);
}
.module_title {
	font-size: 20px;
	font-weight: 600;
	color: var(--primary-dark);
	margin: 0;
}
.module_subtitle {
	font-size: 12px;
	color: var(--grey);
	margin-top: 2px;
}
.module_actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ---- Stats Grid ---- */
.stats_grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}
.stats_card {
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 8px;
	padding: 16px 20px;
	box-shadow: var(--box_shadow);
}
.stats_card_label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--grey);
	margin-bottom: 6px;
}
.stats_card_value {
	font-size: 24px;
	font-weight: 600;
	color: var(--primary-dark);
	line-height: 1.1;
}
.entity_fee_card { position: relative; }
.entity_fee_card .entity_fee_edit_btn { position: absolute; right: 12px; bottom: 12px; }
.stats_card_delta {
	font-size: 11px;
	margin-top: 4px;
}
.stats_card_delta.up   { color: var(--success); }
.stats_card_delta.down { color: var(--danger); }

/* ---- Filter Bar ---- */
.filter_bar {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
	flex-wrap: wrap;
	align-items: center;
}
.filter_bar .inp,
.filter_bar select {
	min-width: 140px;
	max-width: 220px;
}
.filter_bar_search {
	flex: 1;
	min-width: 200px;
}

/* ---- List ---- */
.list_container {
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 8px;
	overflow: hidden;
}
.list_header_row,
.list_row {
	display: grid;
	gap: 12px;
	padding: 12px 16px;
	align-items: center;
	border-bottom: 1px solid var(--grey-light);
}
.list_header_row {
	background-color: var(--grey-off-white);
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--grey-dark);
	letter-spacing: 0.5px;
}
.list_row:last-child   { border-bottom: none; }
.list_row:hover        { background-color: var(--primary-off-white); }
.list_row_cell_mobile_label {
	display: none;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--grey);
	margin-bottom: 2px;
}
.list_empty {
	padding: 36px 16px;
	text-align: center;
	font-size: 13px;
	color: var(--grey);
}
.list_loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 36px 16px;
	font-size: 13px;
	color: var(--grey);
}
.list_loading::before {
	content: '';
	width: 16px;
	height: 16px;
	border: 2px solid var(--grey-light);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: admin-spin 0.7s linear infinite;
}
@keyframes admin-spin { to { transform: rotate(360deg); } }

/* ---- Badge ---- */
.badge {
	display: inline-block;
	width: fit-content;
	max-width: 100%;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 600;
	border-radius: 12px;
	line-height: 1.4;
	white-space: nowrap;
}
.badge_success { background-color: var(--primary-xlight); color: var(--primary-dark); }
.badge_warn    { background-color: var(--warning);       color: var(--warning-dark); }
.badge_danger  { background-color: var(--danger-bg);     color: var(--danger); }
.badge_info    { background-color: var(--grey-light);    color: var(--grey-dark); }
.badge_accent  { background-color: var(--accent-light);  color: var(--accent-dark); }

/* ---- Row action icon buttons ---- */
.row_actions {
	display: flex;
	gap: 4px;
	justify-content: flex-end;
}
.row_action_btn {
	border: none;
	background-color: transparent;
	padding: 4px 8px;
	font-size: 12px;
	color: var(--primary);
	cursor: pointer;
	border-radius: 4px;
}
.row_action_btn:hover { background-color: var(--primary-off-white); }
.row_action_btn.danger { color: var(--danger); }
.row_action_btn.danger:hover { background-color: var(--danger-bg); }

/* ---- Toggle switch (used in MinCatalogs row actions) ---- */
.toggle_switch {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	cursor: pointer;
	flex: 0 0 auto;
}
.toggle_switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}
.toggle_switch_track {
	position: absolute;
	inset: 0;
	background-color: var(--grey-light);
	border-radius: 22px;
	transition: background-color 0.15s ease;
}
.toggle_switch_thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	background-color: var(--white);
	border-radius: 50%;
	transition: transform 0.15s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.toggle_switch input:checked + .toggle_switch_track {
	background-color: var(--primary);
}
.toggle_switch input:checked + .toggle_switch_track .toggle_switch_thumb {
	transform: translateX(18px);
}
.toggle_switch input:focus-visible + .toggle_switch_track {
	outline: 2px solid var(--primary);
	outline-offset: 2px;
}

/* ---- Entities bulk-action dropdown ---- */
.entities_actions_wrap {
	position: relative;
	display: inline-block;
}
.entities_actions_menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	min-width: 220px;
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	z-index: 50;
	padding: 4px;
}
.entities_action_item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 12px;
	background-color: transparent;
	border: none;
	cursor: pointer;
	font-size: 13px;
	color: var(--grey-dark);
	border-radius: 4px;
}
.entities_action_item:hover {
	background-color: var(--primary-off-white);
	color: var(--primary-dark);
}
.entities_action_item:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ---- MinCatalogs thumbnails ---- */
.catalog_thumb {
	width: 40px;
	height: 40px;
	object-fit: contain;
	border: 1px solid var(--grey-light);
	border-radius: 4px;
	background-color: var(--white);
	display: block;
}
.catalog_thumb_empty {
	background-color: var(--grey-off-white);
}

/* ---- Sub-tabs (inside module panel) ---- */
.sub_tabs_nav {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var(--grey-light);
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.sub_tab_btn {
	background-color: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 8px 16px;
	font-size: 13px;
	color: var(--grey-dark);
	cursor: pointer;
}
.sub_tab_btn[data-open='true'] {
	border-bottom-color: var(--primary);
	color: var(--primary-dark);
	font-weight: 600;
}
.sub_tab_btn:not([data-open='true']):hover {
	border-bottom-color: var(--grey-light);
}

/* ---- Cards (role/entity tiles) ---- */
.tile_grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 16px;
}
.tile_card {
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 8px;
	padding: 16px;
	box-shadow: var(--box_shadow);
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.tile_card_title {
	font-size: 15px;
	font-weight: 600;
	color: var(--primary-dark);
}
.tile_card_desc {
	font-size: 12px;
	color: var(--grey-dark);
	flex: 1;
}
.tile_card_meta {
	display: flex;
	gap: 12px;
	font-size: 11px;
	color: var(--grey);
}
.tile_card_actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}

/* ---- Activity feed ---- */
.activity_feed {
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 8px;
	padding: 8px 0;
}
.activity_item {
	padding: 10px 16px;
	border-bottom: 1px solid var(--grey-light);
	display: flex;
	gap: 12px;
	align-items: flex-start;
}
.activity_item:last-child { border-bottom: none; }
.activity_dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--primary);
	margin-top: 6px;
	flex-shrink: 0;
}
.activity_text { flex: 1; font-size: 13px; }
.activity_time { font-size: 11px; color: var(--grey); margin-top: 2px; }

/* ---- Form ---- */
.form_block {
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 8px;
	padding: 20px;
	max-width: 560px;
}
.form_row {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin-bottom: 14px;
}
.form_row label {
	font-size: 12px;
	color: var(--grey-dark);
	font-weight: 600;
}
.form_row input,
.form_row select,
.form_row textarea {
	padding: 8px 12px;
	background-color: var(--input-bg);
	color: var(--off-black);
	border: 1px solid var(--input-border);
	border-radius: 5px;
	outline: none;
	font-size: 14px;
}
.form_row input::placeholder,
.form_row textarea::placeholder { color: var(--grey); opacity: 1; }
.form_row input:hover,
.form_row select:hover,
.form_row textarea:hover { border-color: var(--primary-light); }
.form_row input:focus,
.form_row select:focus,
.form_row textarea:focus { border: 1px solid var(--primary); box-shadow: 0 0 0 2px var(--primary-xlight); }

/* ---- App User Permissions — group header ---- */
.aud_group_header {
	background-color: var(--primary-xlight);
	color: var(--primary-dark);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 10px 16px;
	border-left: 4px solid var(--primary);
	border-bottom: 1px solid var(--grey-light);
	border-radius: 6px 6px 0 0;
}

/* ---- Section divider ---- */
.section_title {
	font-size: 15px;
	font-weight: 600;
	color: var(--primary-dark);
	margin: 24px 0 12px;
}

/* ---- Expandable log row ---- */
.log_row_expanded {
	background-color: var(--grey-off-white);
	border-bottom: 1px solid var(--grey-light);
	padding: 12px 16px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 11px;
	color: var(--grey-dark);
	white-space: pre-wrap;
	overflow-x: auto;
}

/* ============================================================= */
/* Module mobile breakpoints                                      */
/* ============================================================= */
@media (max-width: 767px) {
	.module_header { flex-direction: column; align-items: stretch; }
	.module_actions { justify-content: flex-end; }
	.filter_bar .inp,
	.filter_bar select { max-width: none; width: 100%; }
	.list_header_row { display: none; }
	.list_row {
		grid-template-columns: 1fr !important;
		gap: 4px;
		padding: 12px 14px;
	}
	.list_row > * { width: 100%; }
	.list_row_cell_mobile_label { display: block; }
	.row_actions { justify-content: flex-start; flex-wrap: wrap; }
	.stats_grid { gap: 12px; }
	.stats_card_value { font-size: 20px; }
}

/* ============================================================= */
/* Help Documentation editor (hd_*)                               */
/* ============================================================= */
.hd_muted {
	color: var(--g_medium_txt);
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hd_editor { max-width: 900px; margin: 0 auto; }

.hd_row_sub { font-size: 11px; color: var(--g_medium_txt); margin-top: 2px; }
.hd_row_actions { flex-wrap: wrap; }
.hd_status_line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* list action banner */
.hd_banner {
	background-color: var(--primary-off-white);
	border: 1px solid var(--primary-light);
	border-radius: 8px;
	padding: 14px 16px;
	margin-bottom: 16px;
	font-size: 13px;
	color: var(--grey-dark);
}
.hd_banner_title { font-weight: 600; color: var(--primary-dark); margin-bottom: 8px; }
.hd_banner_list { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 8px; }
.hd_banner_list dt { font-weight: 600; color: var(--off-black); white-space: nowrap; }
.hd_banner_list dd { margin: 0; }
.hd_banner_statuses { font-size: 12px; color: var(--g_medium_txt); border-top: 1px solid var(--primary-light); padding-top: 8px; }

/* actions dropdown (reused by list rows + editor bar) */
.hd_list_container { overflow: visible; }
.hd_actions_wrap { position: relative; display: inline-block; }
.hd_actions_menu {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	min-width: 210px;
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	z-index: 60;
	padding: 4px;
}
.hd_action_item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 12px;
	background-color: transparent;
	border: none;
	cursor: pointer;
	font-size: 13px;
	color: var(--grey-dark);
	border-radius: 4px;
	white-space: nowrap;
}
.hd_action_item:hover { background-color: var(--primary-off-white); color: var(--primary-dark); }
.hd_action_item.danger { color: var(--danger); }
.hd_action_item.danger:hover { background-color: var(--danger-bg); color: var(--danger); }

/* the editor body reads as one card — mirrors the in-app .card / .help_card */
.hd_card {
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 8px;
	box-shadow: var(--box_shadow);
	overflow: hidden;
}
.hd_card_header {
	display: flex;
	flex-direction: column;
	gap: 6px;
	background-color: var(--light_grey_tab_bg);
	border-bottom: 1px solid var(--grey-light);
	padding: 14px 18px;
}
.hd_card_body {
	background-color: var(--white);
	padding: 16px 18px;
}

/* header-style inline-editable inputs (title / description / question) */
.hd_title_inp,
.hd_desc_inp,
.hd_q {
	width: 100%;
	border: 1px solid transparent;
	background-color: transparent;
	border-radius: 5px;
	outline: none;
	color: var(--off-black);
}
.hd_title_inp:hover,
.hd_desc_inp:hover,
.hd_q:hover,
.hd_title_inp:focus,
.hd_desc_inp:focus,
.hd_q:focus { background-color: var(--white); border-color: var(--grey-light); }
.hd_title_inp:focus,
.hd_desc_inp:focus,
.hd_q:focus { border-color: var(--primary); }
.hd_title_inp { font-size: 18px; font-weight: 600; color: var(--primary-dark); padding: 6px 8px; }
.hd_desc_inp { font-size: 13px; color: var(--tab_grey_txt); padding: 5px 8px; }

.hd_sections {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 12px;
}

/* each section reads like an in-app accordion Q&A item (head + body) */
.hd_section {
	background-color: var(--white);
	border: 1px solid var(--grey-light);
	border-radius: 6px;
	overflow: hidden;
}
.hd_section_head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	background-color: var(--light_grey_tab_bg);
	border-bottom: 1px solid var(--grey-light);
}
.hd_section_handle {
	cursor: grab;
	color: var(--grey);
	font-size: 16px;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 4px;
	user-select: none;
}
.hd_section_handle:hover { background-color: var(--grey-off-white); color: var(--grey-dark); }
.hd_section_handle:active { cursor: grabbing; }
.hd_section_head .hd_q { flex: 1; font-size: 14px; font-weight: 600; padding: 6px 8px; }
.hd_section_del {
	border: none;
	background-color: transparent;
	color: var(--danger);
	font-size: 12px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	white-space: nowrap;
}
.hd_section_del:hover { background-color: var(--danger-bg); }
.hd_section_body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 14px 16px;
}

.hd_add_section {
	width: 100%;
	padding: 10px;
	border: 1px dashed var(--grey);
	background-color: transparent;
	color: var(--primary);
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
}
.hd_add_section:hover { border-color: var(--primary); background-color: var(--primary-off-white); }

.hd_imgzone {
	border: 1px dashed var(--grey-light);
	border-radius: 6px;
	padding: 10px;
	background-color: var(--grey-off-white);
}
.hd_imgzone_label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--grey);
	margin-bottom: 8px;
}
.hd_thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 8px;
}
.hd_thumb {
	width: 132px;
	border: 1px solid var(--grey-light);
	border-radius: 6px;
	padding: 8px;
	background-color: var(--white);
	position: relative;
}
.hd_thumb_img {
	cursor: grab;
	height: 80px;
	border-radius: 4px;
	background-color: var(--grey-off-white);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	margin-bottom: 6px;
}
.hd_thumb_img:active { cursor: grabbing; opacity: 0.7; }
.hd_thumb_del {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 20px;
	height: 20px;
	border: none;
	border-radius: 50%;
	background-color: var(--danger);
	color: var(--white);
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
}
.hd_thumb_alt,
.hd_thumb_cap {
	font-size: 12px;
	padding: 5px 8px;
	min-height: 28px;
	margin-top: 4px;
}
.hd_thumb_pending {
	display: inline-block;
	margin-top: 6px;
	font-size: 10px;
	font-weight: 600;
	color: var(--warning-dark);
	background-color: var(--warning);
	padding: 2px 6px;
	border-radius: 8px;
}
.hd_addimg {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	color: var(--primary);
	border: 1px solid var(--primary);
	background-color: var(--white);
	border-radius: 3px;
	padding: 5px 12px;
	cursor: pointer;
}
.hd_addimg:hover { background-color: var(--primary-off-white); }

.hd_wysiwyg {
	border: 1px solid var(--input-border);
	border-radius: 6px;
	overflow: hidden;
	background-color: var(--input-bg);
}
.hd_wysiwyg_toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 6px 8px;
	background-color: var(--light_grey_tab_bg);
	border-bottom: 1px solid var(--grey-light);
}
.hd_wz_btn {
	min-width: 30px;
	height: 28px;
	padding: 0 8px;
	font-size: 13px;
	border: 1px solid var(--grey-light);
	background-color: var(--white);
	color: var(--off-black);
	border-radius: 4px;
	cursor: pointer;
}
.hd_wz_btn:hover { border-color: var(--primary); color: var(--primary); }
.hd_wysiwyg_area {
	min-height: 110px;
	padding: 12px 14px;
	outline: none;
	color: var(--off-black);
	font-size: 13px;
	line-height: 1.5;
}
.hd_wysiwyg_area:empty:before {
	content: attr(data-ph);
	color: var(--grey);
}
.hd_wysiwyg_area ul,
.hd_wysiwyg_area ol { padding-left: 22px; margin: 6px 0; }
.hd_wysiwyg_area a { color: var(--primary); }
.hd_wysiwyg_area p { margin: 0 0 8px; }

@media (max-width: 767px) {
	.hd_editor { max-width: none; }
	.hd_card_body { padding: 12px; }
	.hd_section_head { flex-wrap: wrap; }
	.hd_thumb { width: 100%; }
}

/* ============================================================================
   Banners module — severity badges, list excerpt, edit form WYSIWYG + preview.
   All colours come from theme tokens (defined in both light + :root.theme-dark).
   ============================================================================ */
.bn_excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--off-black);
	font-size: 13px;
}
.bn_row_sub { font-size: 11px; color: var(--g_medium_txt); margin-top: 2px; }

/* Status cell stacks the active toggle, status badge, and schedule sub-line. */
.bn_status_cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
/* Delete is greyed on active banners and reads "Deactivate to delete"; the click also explains why. */
.bn_del_blocked { opacity: 0.6; cursor: not-allowed; white-space: normal; line-height: 1.2; text-align: center; }

/* severity badges (compose with .badge) */
.bn_sev_info     { background-color: var(--primary-xlight); color: var(--primary-dark); }
.bn_sev_warning  { background-color: var(--warning);        color: var(--warning-dark); }
.bn_sev_error    { background-color: var(--danger-bg);      color: var(--danger); }
.bn_sev_critical { background-color: var(--danger);         color: var(--white); }

/* edit form */
.bn_inline_label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 400;
	color: var(--off-black);
}
.bn_inline_label input { width: auto; }

.bn_wysiwyg {
	border: 1px solid var(--input-border);
	border-radius: 6px;
	overflow: hidden;
	background-color: var(--input-bg);
}
.bn_wysiwyg_toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 6px 8px;
	background-color: var(--light_grey_tab_bg);
	border-bottom: 1px solid var(--grey-light);
}
.bn_wz_btn {
	min-width: 30px;
	height: 28px;
	padding: 0 8px;
	font-size: 13px;
	border: 1px solid var(--grey-light);
	background-color: var(--white);
	color: var(--off-black);
	border-radius: 4px;
	cursor: pointer;
}
.bn_wz_btn:hover { border-color: var(--primary); color: var(--primary); }
.bn_wysiwyg_area {
	min-height: 70px;
	padding: 10px 12px;
	outline: none;
	color: var(--off-black);
	font-size: 13px;
	line-height: 1.5;
}
.bn_wysiwyg_area:empty:before { content: attr(data-ph); color: var(--grey); }
.bn_wysiwyg_area a { color: var(--primary); }
.bn_wysiwyg_area p { margin: 0 0 8px; }

/* live preview strip — mirrors the merchant-app banner look */
.bn_preview {
	padding: 11px 14px;
	border-radius: 8px;
	border-left: 4px solid var(--grey-light);
	font-size: 13px;
	line-height: 1.45;
	word-break: break-word;
}
.bn_preview_body a { color: inherit; font-weight: 600; text-decoration: underline; }
.bn_muted { color: var(--grey); font-style: italic; }
.bn_prev_info     { background-color: var(--primary-xlight); border-left-color: var(--primary);      color: var(--off-black); }
.bn_prev_warning  { background-color: var(--warning);        border-left-color: var(--warning-dark); color: var(--warning-dark); }
.bn_prev_error    { background-color: var(--danger-bg);      border-left-color: var(--danger);       color: var(--danger); }
.bn_prev_critical { background-color: var(--danger);         border-left-color: #7A0000;             color: var(--white); }