/* =============================================================================
   admin-ui.css — shared admin interface styles for the relay panel
   -----------------------------------------------------------------------------
   Extracted from the mumin_access.php redesign so it can be reused by any other
   admin page. Link it after Bootstrap 3 (the shared navbar still uses
   .navbar-inverse / .glyphicon) and Font Awesome 6:

       <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css">
       <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css">
       <link rel="stylesheet" href="css/admin-ui.css">

   IMPORTANT: any page that includes includes/navbar.php must also load jQuery and
   Bootstrap 3's JavaScript, because the navbar's "Mumin List" and "Miqaat" menus use
   data-toggle="dropdown". Without bootstrap.min.js the menus only jump to "#" and
   never open:

       <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
       <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js"></script>

   Everything is namespaced under .ma- so it cannot collide with Bootstrap or
   with the legacy pages still using their own inline styles. Note: Font Awesome
   6 dropped the FA5 "-o" aliases, so use fa-trash / fa-file-excel / fa-user
   rather than fa-trash-o / fa-file-excel-o / fa-user-o.

   Page scaffolding expected by these rules:
       <body ng-cloak>
         <div class="ma-wrap">            <!-- max-width container -->
           <div class="ma-head">           <!-- title + optional .ma-stat -->
           <div class="ma-card">          <!-- .ma-card-h + .ma-card-b -->
           <div class="ma-tablewrap">     <!-- overflow wrapper -->
             <table class="ma-table">
   ========================================================================== */

/* ---------- design tokens ---------- */
:root{
	--ma-bg:#f4f6f8;
	--ma-card:#fff;
	--ma-line:#e4e8ee;
	--ma-line-2:#eef1f5;
	--ma-text:#1f2933;
	--ma-muted:#6b7785;
	--ma-accent:#2f6feb;
	--ma-ok:#0f9960;
	--ma-ok-bg:#e6f6ef;
	--ma-warn:#b26a00;
	--ma-warn-bg:#fdf3e2;
	--ma-danger:#c62828;
	--ma-danger-bg:#fdecec;
	--ma-info:#1d6fa5;
	--ma-info-bg:#e8f2f9;
	--ma-purple:#5b3fa8;
	--ma-purple-bg:#f1eefb;
	--ma-r:8px;

	/* Shared height for the two Notice fields (title and content) so the plain
	   textarea and the CKEditor instance are always the same size. */
	--ma-notice-h:220px;


	/* Dark-surface tokens, used only by .ma-nav. The bar is dark so it reads as a
	   header against the pale page and the white cards below it. */
	--ma-nav-bg:#1e2a38;
	--ma-nav-edge:#16212c;
	--ma-nav-hover:rgba(255,255,255,.09);
	--ma-nav-line:rgba(255,255,255,.18);
	--ma-nav-dim:#a8b7c6;
	--ma-nav-accent:#6ea8fe;
	--ma-nav-danger:#ff9186;
	--ma-nav-danger-bg:rgba(255,145,134,.14);
}

/* ---------- base ---------- */
[ng-cloak],.ng-cloak{display:none !important}

html,body{background:var(--ma-bg)}

body{
	font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
	font-size:14px;
	color:var(--ma-text);
	-webkit-font-smoothing:antialiased;
}

.ma-wrap{max-width:1240px;margin:0 auto;padding:22px 18px 60px}

/* ---------- page head ---------- */
.ma-head{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin:0 0 18px}
.ma-head h1{font-size:21px;font-weight:650;margin:0;letter-spacing:-.2px}
.ma-head p{margin:3px 0 0;color:var(--ma-muted);font-size:13px}
.ma-head .ma-grow{flex:1 1 auto;min-width:0}

.ma-stat{background:var(--ma-card);border:1px solid var(--ma-line);border-radius:var(--ma-r);
	padding:9px 16px;display:flex;align-items:baseline;gap:7px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.ma-stat b{font-size:19px;font-weight:650;line-height:1}
.ma-stat span{color:var(--ma-muted);font-size:12px;text-transform:uppercase;letter-spacing:.5px}

/* ---------- cards ---------- */
.ma-card{background:var(--ma-card);border:1px solid var(--ma-line);border-radius:var(--ma-r);
	margin-bottom:16px;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.ma-card-h{display:flex;align-items:center;gap:9px;padding:13px 16px;border-bottom:1px solid var(--ma-line-2)}
.ma-card-h h2{font-size:13px;font-weight:650;margin:0;text-transform:uppercase;letter-spacing:.6px;color:var(--ma-muted)}
.ma-card-h .ma-grow{flex:1 1 auto}
.ma-card-b{padding:16px}
.ma-card-b--flush{padding:0}

/* ---------- forms ---------- */
.ma-grid{display:grid;gap:12px;align-items:end;
	grid-template-columns:130px minmax(150px,1.4fr) 165px 175px minmax(150px,1.4fr) auto}
@media (max-width:1000px){.ma-grid{grid-template-columns:1fr 1fr}}
@media (max-width:600px){.ma-grid{grid-template-columns:1fr}}

/* Variant for the Live Miqaat form: name and server link need the most room,
   the two dropdowns and the date can be narrower. */
.ma-grid--event{grid-template-columns:minmax(160px,1.5fr) minmax(160px,1.5fr) 200px 150px 130px auto}
@media (max-width:1100px){.ma-grid--event{grid-template-columns:1fr 1fr}}
@media (max-width:600px){.ma-grid--event{grid-template-columns:1fr}}

.ma-f label{display:block;font-size:11.5px;font-weight:600;color:var(--ma-muted);
	text-transform:uppercase;letter-spacing:.4px;margin:0 0 5px}

.ma-in{width:100%;height:38px;padding:7px 11px;font-size:14px;color:var(--ma-text);
	background:#fff;border:1px solid #cbd3dd;border-radius:6px;
	transition:border-color .12s,box-shadow .12s}
.ma-in:focus{outline:0;border-color:var(--ma-accent);box-shadow:0 0 0 3px rgba(47,111,235,.14)}
.ma-in::placeholder{color:#9aa5b1}

.ma-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:38px;padding:0 16px;
	font-size:14px;font-weight:600;border-radius:6px;border:1px solid transparent;cursor:pointer;
	background:var(--ma-accent);color:#fff;white-space:nowrap;
	transition:filter .12s,box-shadow .12s}
.ma-btn:hover{filter:brightness(1.07);color:#fff}
.ma-btn:active{filter:brightness(.95)}
.ma-btn:focus-visible{outline:0;box-shadow:0 0 0 3px rgba(47,111,235,.28)}
.ma-btn[disabled]{opacity:.55;cursor:not-allowed}

/* ---------- toolbar ---------- */
.ma-tools{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px 16px;
	border-bottom:1px solid var(--ma-line-2);background:#fbfcfd;
	border-radius:var(--ma-r) var(--ma-r) 0 0}

.ma-search{position:relative;flex:1 1 260px;max-width:340px;min-width:200px}
.ma-search .fa-search{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:#9aa5b1;font-size:13px}
.ma-search input{padding-left:32px;padding-right:30px}
.ma-search .ma-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);border:0;background:none;
	color:#9aa5b1;cursor:pointer;padding:4px 6px;line-height:1;font-size:13px}
.ma-search .ma-clear:hover{color:var(--ma-text)}

.ma-div{width:1px;height:22px;background:var(--ma-line)}

.ma-chip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px;font-size:13px;font-weight:600;
	border-radius:16px;border:1px solid var(--ma-line);background:#fff;color:var(--ma-text);text-decoration:none}
.ma-chip:hover{background:#f2f5f9;color:var(--ma-text);text-decoration:none}
.ma-chip--ok{border-color:#bfe6d3;background:var(--ma-ok-bg);color:var(--ma-ok)}
.ma-chip--warn{border-color:#f0dcb4;background:var(--ma-warn-bg);color:var(--ma-warn)}
.ma-chip--danger{border-color:#f3c9c9;background:var(--ma-danger-bg);color:var(--ma-danger)}
.ma-chip[disabled]{opacity:.5;pointer-events:none}

/* ---------- table ---------- */
.ma-tablewrap{overflow-x:auto}

.ma-table{width:100%;border-collapse:collapse;font-size:13.5px}
.ma-table th{position:sticky;top:0;z-index:2;background:#f7f9fb;text-align:left;font-size:11.5px;
	font-weight:700;color:var(--ma-muted);text-transform:uppercase;letter-spacing:.5px;
	padding:10px 12px;border-bottom:1px solid var(--ma-line);white-space:nowrap}
.ma-table td{padding:9px 12px;border-bottom:1px solid var(--ma-line-2);vertical-align:middle}
.ma-table tbody tr:hover{background:#f8fafc}
.ma-table tbody tr:last-child td{border-bottom:0}

.ma-table .ma-n{width:44px;color:#9aa5b1;font-variant-numeric:tabular-nums}
.ma-table .ma-c{width:38px}
.ma-table .ma-nowrap{white-space:nowrap}
.ma-table .ma-right{text-align:right}

.ma-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}
.ma-name{font-weight:600}
.ma-sub{color:var(--ma-muted);font-size:12.5px;margin-top:1px}
.ma-sub:empty{display:none}

input[type=checkbox].ma-box{width:16px;height:16px;margin:0;vertical-align:middle;
	cursor:pointer;accent-color:var(--ma-accent)}

/* ---------- stacked cell: badge with a toggle button underneath ----------
   Used by the Relay Type and Stream Key columns, where the current value is
   shown as a badge and the switch sits on the line below rather than beside
   it, so the button does not stretch the column. */
.ma-stack{display:flex;flex-direction:column;align-items:flex-start;gap:5px}
.ma-stack .ma-ibtn{width:100%}

/* ---------- badges ---------- */
.ma-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:11px;
	font-size:12px;font-weight:650;line-height:1.5;white-space:nowrap}
.ma-badge--live{background:var(--ma-ok-bg);color:var(--ma-ok)}
.ma-badge--stream{background:var(--ma-info-bg);color:var(--ma-info)}
.ma-badge--on{background:var(--ma-ok-bg);color:var(--ma-ok)}
.ma-badge--off{background:#eef1f5;color:var(--ma-muted)}
.ma-badge--av{background:var(--ma-purple-bg);color:var(--ma-purple)}
.ma-badge--au{background:var(--ma-warn-bg);color:var(--ma-warn)}

/* ---------- row actions ---------- */
.ma-acts{display:flex;flex-wrap:wrap;gap:5px}

.ma-ibtn{display:inline-flex;align-items:center;justify-content:center;gap:5px;height:28px;padding:0 9px;
	font-size:12.5px;font-weight:600;border-radius:6px;border:1px solid var(--ma-line);
	background:#fff;color:var(--ma-text);text-decoration:none;cursor:pointer;white-space:nowrap}
.ma-ibtn:hover{background:#f2f5f9;color:var(--ma-text);text-decoration:none;border-color:#cfd7e0}
.ma-ibtn:focus-visible{outline:0;box-shadow:0 0 0 3px rgba(47,111,235,.22)}
.ma-ibtn--danger{color:var(--ma-danger);border-color:#f0cfcf}
.ma-ibtn--danger:hover{background:var(--ma-danger-bg);color:var(--ma-danger);border-color:#e4b4b4}
.ma-ibtn--warn{color:var(--ma-warn);border-color:#eedfc4}
.ma-ibtn--warn:hover{background:var(--ma-warn-bg);color:var(--ma-warn)}
.ma-ibtn--key{color:var(--ma-info);border-color:#cfe0ec}
.ma-ibtn--key:hover{background:var(--ma-info-bg);color:var(--ma-info)}
.ma-ibtn--type{color:var(--ma-purple);border-color:#ded5f4}
.ma-ibtn--type:hover{background:var(--ma-purple-bg);color:var(--ma-purple)}
.ma-ibtn[disabled]{opacity:.5;pointer-events:none}

/* ---------- states ---------- */
.ma-empty{padding:46px 20px;text-align:center;color:var(--ma-muted)}
.ma-empty .fa{font-size:26px;color:#c3ccd6;display:block;margin-bottom:10px}
.ma-empty b{display:block;color:var(--ma-text);font-size:14.5px;margin-bottom:3px}

.ma-foot{padding:11px 16px;color:var(--ma-muted);font-size:12.5px;border-top:1px solid var(--ma-line-2)}

/* Screen-reader-only text (labels for icon controls, etc). */
.ma-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
	clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Shown only if a CDN script fails and the AngularJS page cannot boot.
   Hidden by default here; the page's watchdog sets style.display='block'. */
.ma-bootfail{display:none;margin:22px 18px 0;padding:13px 16px;border:1px solid #f0cfcf;
	background:var(--ma-danger-bg);color:var(--ma-danger);border-radius:var(--ma-r);font-size:13.5px}
.ma-bootfail .fa{margin-right:8px}

/* Small inline-ish helpers that would otherwise need a style="" attribute. */
.ma-hint{text-transform:none;letter-spacing:0;font-weight:400}
.ma-th-sub{text-transform:none;letter-spacing:0;font-weight:500}

/* ---------- file upload ---------- */
.ma-file{display:block;width:100%;height:38px;padding:6px 10px;font-size:13px;color:var(--ma-muted);
	background:#fff;border:1px dashed #cbd3dd;border-radius:6px;cursor:pointer}
.ma-file:hover{border-color:var(--ma-accent);color:var(--ma-text)}
.ma-file::file-selector-button{height:26px;margin:-6px 10px -6px -10px;padding:0 12px;border:0;
	border-right:1px solid #cbd3dd;background:#f2f5f9;color:var(--ma-text);
	font-size:12.5px;font-weight:600;cursor:pointer}
.ma-file::file-selector-button:hover{background:#e8edf3}

/* ---------- summary tiles ---------- */
.ma-tiles{display:flex;flex-wrap:wrap;gap:10px}
/* Tiles placed inside a card header: pushed to the right instead of wrapping. */
.ma-tiles--head{margin-left:auto;flex:0 1 auto}
/* A standalone row of tiles above a panel grid. */
.ma-tiles--block{margin-bottom:16px}
.ma-tile{flex:1 1 150px;min-width:130px;background:#fbfcfd;border:1px solid var(--ma-line);
	border-radius:var(--ma-r);padding:11px 14px}
.ma-tile b{display:block;font-size:20px;font-weight:650;line-height:1.15}
.ma-tile span{color:var(--ma-muted);font-size:11.5px;text-transform:uppercase;letter-spacing:.5px}
.ma-tile--ok b{color:var(--ma-ok)}
.ma-tile--info b{color:var(--ma-info)}
.ma-tile--danger b{color:var(--ma-danger)}

/* ---------- notice banners ---------- */
.ma-notice{display:flex;gap:10px;padding:12px 14px;border-radius:var(--ma-r);margin-bottom:16px;
	border:1px solid var(--ma-line);background:#fbfcfd;font-size:13.5px}
.ma-notice .fa{margin-top:2px}
.ma-notice b{display:block}
.ma-notice--ok{border-color:#bfe6d3;background:var(--ma-ok-bg);color:var(--ma-ok)}
.ma-notice--warn{border-color:#f0dcb4;background:var(--ma-warn-bg);color:var(--ma-warn)}
.ma-notice--danger{border-color:#f3c9c9;background:var(--ma-danger-bg);color:var(--ma-danger)}

/* ---------- button row ---------- */
.ma-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:14px}

/* ---------- monospace format reference ---------- */
.ma-code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;
	background:#f7f9fb;border:1px solid var(--ma-line);border-radius:6px;
	padding:10px 12px;white-space:pre;overflow-x:auto;color:var(--ma-text)}

/* ---------- definition-style key/value hints ---------- */
.ma-hintgrid{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:10px 0 0;font-size:13px}
.ma-hintgrid dt{color:var(--ma-muted);font-weight:600}
.ma-hintgrid dd{margin:0}

/* ---------- side-by-side panel layout (dashboards) ----------
   The wider second column suits a table with more columns than the first. */
.ma-panels{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);gap:16px;align-items:start}
@media (max-width:992px){.ma-panels{grid-template-columns:minmax(0,1fr)}}
.ma-panels .ma-card{margin-bottom:0}

/* ---------- "updated hh:mm:ss" stamp in a card header ---------- */
.ma-sync{color:var(--ma-muted);font-size:12.5px;font-variant-numeric:tabular-nums;white-space:nowrap}
.ma-sync .fa{margin-right:5px}

/* ---------- inline meter (relative bar, width set by script from data-pct) ---------- */
.ma-meter{height:6px;min-width:56px;background:var(--ma-line-2);border-radius:3px;overflow:hidden}
.ma-meter i{display:block;height:100%;background:var(--ma-accent);border-radius:3px}
.ma-meterline{display:flex;align-items:center;gap:9px}
.ma-meterline b{font-variant-numeric:tabular-nums;min-width:28px;text-align:right}

/* ---------- log-type badges (activity log) ---------- */
.ma-badge--log-in{background:var(--ma-ok-bg);color:var(--ma-ok)}
.ma-badge--log-dup{background:var(--ma-warn-bg);color:var(--ma-warn)}
.ma-badge--log-dev{background:var(--ma-danger-bg);color:var(--ma-danger)}
.ma-badge--log-src{background:var(--ma-info-bg);color:var(--ma-info)}

/* ---------- live dot for the auto-refreshing panels ---------- */
.ma-live{display:inline-flex;align-items:center;gap:6px;color:var(--ma-ok);font-size:12.5px;font-weight:600}
.ma-live::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--ma-ok)}
.ma-live--off{color:var(--ma-muted)}
.ma-live--off::before{background:#c3ccd6}

/* ---------- equal-height panel with a scrolling body ----------
   For two cards side by side where the second holds far more rows than the
   first. The card is a flex column so its header and footer stay put, and only
   the body scrolls. The page measures the first card and caps this one with an
   inline max-height, since CSS cannot size one grid item against its sibling.
   The table's sticky <th> keeps the column headings visible while scrolling. */
.ma-card--scroll{display:flex;flex-direction:column;min-height:0}
.ma-scroll{overflow-y:auto;overflow-x:auto;min-height:0;flex:1 1 auto;overscroll-behavior:contain}
.ma-scroll .ma-table th{position:sticky;top:0;z-index:2}
.ma-scroll .ma-table th::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:var(--ma-line)}
.ma-scroll::-webkit-scrollbar{width:9px;height:9px}
.ma-scroll::-webkit-scrollbar-track{background:var(--ma-line-2);border-radius:5px}
.ma-scroll::-webkit-scrollbar-thumb{background:#c3ccd6;border-radius:5px;border:2px solid #fff}
.ma-scroll::-webkit-scrollbar-thumb:hover{background:#a9b4c0}

/* ---------- admin navigation bar ----------
   A dark bar so it reads as a distinct surface: the page body is a pale grey
   (#f4f6f8) and the cards on it are white, so a white navbar blended into the
   first card instead of looking like a header.

   The Bootstrap class names (dropdown / dropdown-toggle / dropdown-menu) are
   deliberately kept, because Bootstrap 3's JavaScript keys off them to open the
   menus and toggles the "open" class on the parent <li>. So the page must still
   load bootstrap.min.js.

   Deliberately uses no icon font, so it renders identically on pages that do not
   load Font Awesome (report.php). */
.ma-nav{background:var(--ma-nav-bg);border-bottom:1px solid var(--ma-nav-edge);
	box-shadow:0 1px 3px rgba(16,24,40,.18);position:relative;z-index:1000}
.ma-nav__inner{max-width:1240px;margin:0 auto;padding:0 18px;display:flex;align-items:center;
	gap:18px;flex-wrap:wrap;min-height:56px}
.ma-nav__brand{display:inline-flex;align-items:center;gap:9px;font-size:15px;font-weight:650;
	color:#fff;text-decoration:none;padding:15px 0;white-space:nowrap}
.ma-nav__brand:hover,.ma-nav__brand:focus{color:#fff;text-decoration:none}
.ma-nav__brand::before{content:"";width:9px;height:9px;border-radius:2px;
	background:var(--ma-nav-accent);flex:0 0 auto}

.ma-nav__list{display:flex;align-items:center;gap:2px;list-style:none;margin:0;padding:0;flex-wrap:wrap}
.ma-nav__list--right{margin-left:auto}
.ma-nav__item{position:relative}

.ma-nav__link{display:inline-flex;align-items:center;gap:6px;padding:9px 12px;font-size:13.5px;
	font-weight:600;line-height:1.4;color:var(--ma-nav-dim);text-decoration:none;
	border-bottom:2px solid transparent;border-radius:0;
	transition:color .12s,border-color .12s,background .12s}
.ma-nav__link:hover,.ma-nav__link:focus{color:#fff;background:var(--ma-nav-hover);text-decoration:none}
.ma-nav__item.is-active > .ma-nav__link{color:#fff;border-bottom-color:var(--ma-nav-accent)}

/* CSS-drawn caret, rotated when the menu is open. */
.ma-nav__caret{width:0;height:0;flex:0 0 auto;opacity:.75;
	border-left:4px solid transparent;border-right:4px solid transparent;
	border-top:4px solid currentColor;transition:transform .15s}
.ma-nav__item.open > .ma-nav__link{color:#fff;background:var(--ma-nav-hover)}
.ma-nav__item.open > .ma-nav__link .ma-nav__caret{transform:rotate(180deg)}

/* Dropdown panel stays light, which is what makes it legible against the dark bar. */
.ma-nav .dropdown-menu{position:absolute;top:100%;left:0;min-width:190px;margin:0;padding:6px;
	list-style:none;background:var(--ma-card);border:1px solid var(--ma-line);
	border-radius:var(--ma-r);box-shadow:0 8px 24px rgba(16,24,40,.18);display:none}
/* Bridge the 1px gap between the bar and the panel so the pointer can travel. */
.ma-nav .dropdown-menu:before{content:"";display:block;height:7px;margin:-7px 0 1px}
.ma-nav .open > .dropdown-menu{display:block}
.ma-nav .dropdown-menu > li > a{display:block;padding:8px 11px;font-size:13.5px;font-weight:500;
	color:var(--ma-text);border-radius:6px;text-decoration:none;white-space:nowrap}
.ma-nav .dropdown-menu > li > a:hover,.ma-nav .dropdown-menu > li > a:focus{background:#f2f5f9;
	color:var(--ma-text);text-decoration:none}
.ma-nav .dropdown-menu > li.active > a{background:var(--ma-info-bg);color:var(--ma-info);font-weight:650}

.ma-nav__sep{width:1px;height:24px;background:var(--ma-nav-line);margin:0 8px;flex:0 0 auto}
.ma-nav__link--logout{color:var(--ma-nav-danger)}
.ma-nav__link--logout:hover,.ma-nav__link--logout:focus{background:var(--ma-nav-danger-bg);color:var(--ma-nav-danger)}

@media (max-width:680px){
	.ma-nav__inner{padding:0 12px;gap:10px;min-height:0}
	.ma-nav__list{width:100%;padding-bottom:6px}
	.ma-nav__list--right{margin-left:0}
	.ma-nav__sep{display:none}
	.ma-nav .dropdown-menu{position:static;float:none;box-shadow:none;border:0;
		border-left:2px solid var(--ma-nav-line);border-radius:0;margin:2px 0 4px 6px;padding:0 0 0 6px;
		min-width:0;display:none}
	.ma-nav .open > .dropdown-menu{display:block}
}

/* ---------- inline editing inside a grid cell ---------- */
.ma-edit{min-height:20px;padding:2px 4px;margin:-2px -4px;border-radius:4px;
	border:1px solid transparent;cursor:text;white-space:pre-wrap;word-break:break-word}
.ma-edit:hover{background:#f2f5f9;border-color:#dde3ea}
.ma-edit:focus{outline:0;background:#fff;border-color:var(--ma-accent);
	box-shadow:0 0 0 3px rgba(47,111,235,.14)}

/* A select used as a cell editor. The option text is the friendly label while
   the value stays the raw 0/1 the database expects. */
.ma-cellsel{height:26px;max-width:130px;padding:2px 6px;font-size:12.5px;font-weight:600;
	color:var(--ma-text);background:#fff;border:1px solid var(--ma-line);border-radius:6px;cursor:pointer}
.ma-cellsel:focus{outline:0;border-color:var(--ma-accent);box-shadow:0 0 0 3px rgba(47,111,235,.18)}
.ma-cellsel option{font-weight:400;color:var(--ma-text)}

/* ---------- transient save confirmation (replaces .alert) ---------- */
.ma-flash{position:fixed;right:18px;bottom:18px;z-index:1080;display:flex;align-items:center;gap:9px;
	padding:11px 15px;border-radius:var(--ma-r);font-size:13.5px;font-weight:600;
	background:var(--ma-card);border:1px solid var(--ma-line);
	box-shadow:0 6px 20px rgba(16,24,40,.14);opacity:0;transform:translateY(8px);
	transition:opacity .18s,transform .18s;pointer-events:none}
.ma-flash.is-on{opacity:1;transform:none}
.ma-flash--ok{border-color:#bfe6d3;background:var(--ma-ok-bg);color:var(--ma-ok)}
.ma-flash--warn{border-color:#f0dcb4;background:var(--ma-warn-bg);color:var(--ma-warn)}

/* ---------- DataTables theming, for server-side grids ----------
   Wrap the table in .ma-dt and keep .ma-table on the table itself. DataTables
   injects its own length/search/pagination markup, which would otherwise pick up
   Bootstrap's default form styling. */
.ma-dt .dataTables_length,.ma-dt .dataTables_filter{display:inline-block;margin:0 10px 12px 0;
	font-size:13px;color:var(--ma-muted)}
.ma-dt .dataTables_length select,.ma-dt .dataTables_filter input{display:inline-block;height:32px;
	margin-left:6px;padding:4px 9px;font-size:13px;color:var(--ma-text);background:#fff;
	border:1px solid #cbd3dd;border-radius:6px;box-shadow:none}
.ma-dt .dataTables_filter input:focus{outline:0;border-color:var(--ma-accent);
	box-shadow:0 0 0 3px rgba(47,111,235,.14)}
.ma-dt .dataTables_info{margin:12px 0 0;color:var(--ma-muted);font-size:12.5px}
.ma-dt .dataTables_paginate{margin:12px 0 0;padding-top:0;text-align:right;border-top:0}
.ma-dt .dataTables_paginate .paginate_button{display:inline-block;min-width:30px;margin:0 2px;
	padding:5px 9px;font-size:12.5px;font-weight:600;line-height:1.4;text-align:center;
	color:var(--ma-text);background:#fff;border:1px solid var(--ma-line);border-radius:6px;
	cursor:pointer;text-decoration:none}
.ma-dt .dataTables_paginate .paginate_button:hover{background:#f2f5f9;text-decoration:none}
.ma-dt .dataTables_paginate .paginate_button.current{background:var(--ma-accent);
	border-color:var(--ma-accent);color:#fff}
.ma-dt .dataTables_paginate .paginate_button.disabled{opacity:.45;pointer-events:none}
.ma-dt table.dataTable{border-collapse:collapse}
.ma-dt table.dataTable thead th{padding:10px 12px;background:#f7f9fb;text-align:left;
	font-size:11.5px;font-weight:700;color:var(--ma-muted);text-transform:uppercase;letter-spacing:.5px;
	border-bottom:1px solid var(--ma-line);white-space:nowrap}
.ma-dt table.dataTable tbody td{padding:9px 12px;border-bottom:1px solid var(--ma-line-2)}
.ma-dt table.dataTable tbody tr:hover{background:#f8fafc}
.ma-dt table.dataTable tbody tr:last-child td{border-bottom:0}

/* ---------- text areas ---------- */
.ma-textarea{display:block;width:100%;min-height:110px;padding:9px 11px;font-size:14px;
	line-height:1.5;color:var(--ma-text);background:#fff;border:1px solid #cbd3dd;border-radius:6px;
	resize:vertical;transition:border-color .12s,box-shadow .12s}
.ma-textarea:focus{outline:0;border-color:var(--ma-accent);box-shadow:0 0 0 3px rgba(47,111,235,.14)}
.ma-textarea--tall{min-height:260px}

/* ---------- image preview tile (logo / banner fields) ---------- */
.ma-media{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.ma-media__preview{width:88px;height:88px;flex:0 0 auto;border:1px solid var(--ma-line);
	border-radius:var(--ma-r);background:#f7f9fb;display:flex;align-items:center;
	justify-content:center;overflow:hidden}
.ma-media__preview img{width:100%;height:100%;object-fit:contain;display:block}
.ma-media__preview i{font-size:22px;color:#c3ccd6}
.ma-media__side{flex:1 1 220px;min-width:0}
.ma-media__name{color:var(--ma-muted);font-size:12.5px;margin-top:6px;word-break:break-all;
	font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

/* ---------- read-only value display inside a form row ---------- */
.ma-static{padding:8px 0;color:var(--ma-text);font-size:14px}
.ma-static small{display:block;color:var(--ma-muted);font-size:12px;margin-top:2px}

/* ---------- small layout helpers ---------- */
/* A .ma-row that sits directly under a label instead of being pushed down. */
.ma-row--tight{margin-top:0}
/* The empty state, tightened for use inside a table cell. */
.ma-empty--sm{padding:34px 20px}

/* Report selector: one wide dropdown plus its buttons. */
.ma-grid--report{grid-template-columns:minmax(220px,1fr) auto;align-items:end}
@media (max-width:700px){.ma-grid--report{grid-template-columns:1fr}}

/* Settings form: label column plus a control column. */
.ma-grid--settings{grid-template-columns:210px minmax(0,1fr);align-items:start}
@media (max-width:700px){.ma-grid--settings{grid-template-columns:1fr}}

/* Add-admin / change-password forms: three equal fields, a narrower password,
   then the action buttons. */
.ma-grid--admin{grid-template-columns:130px minmax(140px,1.2fr) 150px minmax(140px,1fr) auto auto}
@media (max-width:1000px){.ma-grid--admin{grid-template-columns:1fr 1fr}}
@media (max-width:600px){.ma-grid--admin{grid-template-columns:1fr}}

/* Small explanatory line under a form control. */
.ma-fieldhint{display:block;margin-top:6px;color:var(--ma-muted);font-size:12.5px}

/* ---------- Branding: two identical image fields side by side ----------
   Previously these sat in a label/content grid, one per row, so the previews and
   their file inputs did not line up. Two equal columns of identical cells keeps
   them aligned, and the extra border makes each field read as one unit. */
.ma-grid--media{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media (max-width:820px){.ma-grid--media{grid-template-columns:minmax(0,1fr)}}

.ma-media-cell{border:1px solid var(--ma-line);border-radius:var(--ma-r);
	padding:14px;background:#fbfcfd}
.ma-media-cell .ma-f label{margin-bottom:9px}

/* ---------- Notice: label above control, both fields the same height ----------
   --ma-notice-h is the single source of truth. profile_settings.php reads it back
   in JavaScript to size CKEditor, so the rich-text box and the plain title box
   cannot drift apart. Change the token and both follow. */
.ma-grid--notice{display:grid;grid-template-columns:minmax(0,1fr);gap:18px}
.ma-grid--notice .ma-f label{margin-bottom:7px}
.ma-textarea--pair{min-height:var(--ma-notice-h,220px)}

/* CKEditor builds its own chrome, so make it fill the cell it replaces. */
.ma-grid--notice .cke{width:100% !important;border-color:#cbd3dd !important;border-radius:6px}
.ma-grid--notice .cke_chrome{width:100% !important}
.ma-grid--notice .cke_contents{height:auto !important}
