/* ════════════════════════════════════════════════════════════════════
   ICMS EXTRAS — Phase 2.5 (2026-04-30)
   ════════════════════════════════════════════════════════════════════
   Loaded LAST. Styles for:
     • Notification bell + dropdown panel (header, user-side)
     • Top-up affordance on credit pill
     • Avatar initials fallback
     • Profile modal close-button emphasis
     • Re-unlock payment modal (30-day window)
     • Admin notifications composer + sent-list
   ════════════════════════════════════════════════════════════════════ */

/* ── Avatar initials fallback (always visible) ─────────────── */
.user-pill .icms-avatar-initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--gold-500, #d4a35a), var(--gold-700, #946b29));
	color: var(--ink-900, #0a1228);
	font-family: var(--font-display, Georgia), serif;
	font-size: 13px;
	font-weight: 800;
	flex-shrink: 0;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
	letter-spacing: -0.01em;
	text-transform: uppercase;
}
.user-pill img.icms-avatar-img,
.user-pill img[src][alt="Avatar"] {
	width: 32px !important;
	height: 32px !important;
	border-radius: 50% !important;
	object-fit: cover !important;
	flex-shrink: 0 !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18) !important;
}

/* ── Top-up affordance on credit pill ───────────────────────── */
.quota-pill .icms-quota-plus {
	display: inline-flex;
	align-items: center;
	margin-left: 8px;
	color: var(--gold-400, #e3bd83);
	font-size: 14px;
	transition: transform 0.2s var(--ease, cubic-bezier(.2,.7,.2,1));
}
.quota-pill:hover .icms-quota-plus {
	transform: scale(1.15) rotate(90deg);
}

/* ── Notification bell ──────────────────────────────────────── */
.icms-notif-wrap {
	position: relative;
	margin-right: 6px;
}
.icms-notif-btn {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.75);
	width: 38px;
	height: 38px;
	border-radius: 50%;
	cursor: pointer;
	display: grid;
	place-items: center;
	font-size: 15px;
	position: relative;
	transition: all 0.2s var(--ease, cubic-bezier(.2,.7,.2,1));
}
.icms-notif-btn:hover {
	background: rgba(212, 163, 90, 0.15);
	border-color: rgba(212, 163, 90, 0.4);
	color: var(--gold-400, #e3bd83);
}
.icms-notif-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #dc2626;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
	border: 2px solid var(--ink-900, #0a1228);
	font-family: var(--font-mono, monospace);
	letter-spacing: -0.02em;
	box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5);
	animation: icms-bell-pulse 2.5s ease-out infinite;
}
@keyframes icms-bell-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
	70%  { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
	100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Notification panel — positioned by JS at runtime via position:fixed.
   Appended to <body> directly so NO ancestor stacking context can clip it.
   z-index 2147483647 (max int) is overkill but rules out any conflict. */
.icms-notif-panel {
	width: 380px;
	max-width: calc(100vw - 24px);
	background: #fff;
	border: 1px solid var(--ink-100, #e7ebf3);
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(10, 18, 40, 0.18), 0 8px 16px rgba(10, 18, 40, 0.08);
	z-index: 2147483647;
	overflow: hidden;
	animation: icms-notif-pop 0.18s ease-out;
	position: fixed;
}
.icms-notif-panel[hidden] { display: none !important; }
@keyframes icms-notif-pop {
	from { opacity: 0; transform: translateY(-8px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}
.icms-notif-panel-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 18px;
	border-bottom: 1px solid var(--ink-100, #e7ebf3);
	background: var(--surface, #faf7f2);
	font-family: var(--font-display, Georgia), serif;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--ink-900, #0a1228);
	letter-spacing: -0.015em;
}
.icms-notif-mark-all {
	background: none;
	border: 0;
	color: var(--gold-700, #946b29);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 4px 10px;
	border-radius: 6px;
	transition: background 0.2s;
	font-family: inherit;
}
.icms-notif-mark-all:hover { background: var(--gold-100, #fbf2e3); }
.icms-notif-panel-body {
	max-height: 440px;
	overflow-y: auto;
}
.icms-notif-empty {
	padding: 32px 20px;
	text-align: center;
	color: var(--ink-400, #6b7794);
	font-size: 13px;
}
.icms-notif-empty i {
	display: block;
	font-size: 24px;
	margin-bottom: 8px;
	color: var(--ink-200, #c5cdde);
}
.icms-notif-item {
	display: flex;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--ink-100, #e7ebf3);
	cursor: pointer;
	transition: background 0.15s;
	position: relative;
}
.icms-notif-item:last-child { border-bottom: 0; }
.icms-notif-item:hover { background: var(--surface, #faf7f2); }
.icms-notif-item--unread {
	background: var(--gold-50, #fdf9f2);
}
.icms-notif-item--unread::before {
	content: '';
	position: absolute;
	left: 6px;
	top: 50%;
	transform: translateY(-50%);
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--gold-500, #d4a35a);
}
.icms-notif-icon {
	flex-shrink: 0;
	width: 32px;
	height: 32px;
	border-radius: 9px;
	display: grid;
	place-items: center;
	font-size: 13px;
}
.icms-notif-item--info .icms-notif-icon         { background: #eff6ff; color: #2563eb; }
.icms-notif-item--success .icms-notif-icon      { background: #f0fdf4; color: #16a34a; }
.icms-notif-item--warning .icms-notif-icon      { background: #fff7ed; color: #ea580c; }
.icms-notif-item--announcement .icms-notif-icon { background: #faf5ff; color: #9333ea; }
.icms-notif-item--promo .icms-notif-icon        { background: var(--gold-100, #fbf2e3); color: var(--gold-700, #946b29); }
.icms-notif-body { flex: 1; min-width: 0; }
.icms-notif-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--ink-900, #0a1228);
	margin-bottom: 2px;
	letter-spacing: -0.01em;
}
.icms-notif-text {
	font-size: 12.5px;
	color: var(--ink-600, #2d4068);
	line-height: 1.45;
	margin-bottom: 4px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.icms-notif-time {
	font-size: 11px;
	color: var(--ink-400, #6b7794);
	font-family: var(--font-mono, monospace);
	letter-spacing: 0.02em;
}

/* ── Profile modal close-button emphasis ────────────────────── */
.icms-modal-close-emphasis {
	background: rgba(220, 38, 38, 0.15) !important;
	border-color: rgba(220, 38, 38, 0.4) !important;
	color: #fca5a5 !important;
	width: 36px !important;
	height: 36px !important;
	border-radius: 50% !important;
	font-size: 16px !important;
}
.icms-modal-close-emphasis:hover {
	background: rgba(220, 38, 38, 0.3) !important;
	color: #fff !important;
	transform: scale(1.05);
}

/* RE-UNLOCK MODAL styles removed — paywall retired. */

/* ════════════════════════════════════════════════════════════════
   ADMIN NOTIFICATIONS UI
   ════════════════════════════════════════════════════════════════ */
.icms-admin-notifs {
	background: var(--surface-card, #fff);
	border: 1px solid var(--ink-100, #e7ebf3);
	border-radius: 16px;
	padding: 24px;
	margin: 24px 0;
	box-shadow: var(--shadow-sm, 0 1px 3px rgba(10,18,40,.06));
}
.icms-admin-notifs-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--ink-100, #e7ebf3);
	flex-wrap: wrap;
}
.icms-admin-notifs-head h2 {
	font-family: var(--font-display, Georgia), serif;
	font-size: 1.3rem;
	font-weight: 800;
	color: var(--ink-900, #0a1228);
	margin: 0 0 4px;
	letter-spacing: -0.02em;
	display: flex;
	align-items: center;
	gap: 10px;
}
.icms-admin-notifs-head h2 i {
	color: var(--gold-600, #b88736);
	font-size: 0.85em;
}
.icms-admin-notifs-head p {
	margin: 0;
	font-size: 13px;
	color: var(--ink-500, #485776);
}
.icms-admin-notifs-toggle {
	background: var(--ink-900, #0a1228);
	color: #fff;
	border: 0;
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: inherit;
	transition: background 0.2s, transform 0.2s;
	flex-shrink: 0;
}
.icms-admin-notifs-toggle:hover {
	background: var(--ink-800, #142243);
	transform: translateY(-1px);
}
.icms-admin-notifs-form {
	background: var(--surface, #faf7f2);
	padding: 20px;
	border-radius: 12px;
	border: 1px solid var(--ink-100, #e7ebf3);
	margin-bottom: 20px;
}
.icms-admin-notifs-form[hidden] { display: none; }
.icms-admin-notifs-row {
	margin-bottom: 14px;
}
.icms-admin-notifs-row label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--ink-700, #1f2f54);
	margin-bottom: 5px;
}
.icms-admin-notifs-row label .req { color: #dc2626; }
.icms-admin-notifs-row input,
.icms-admin-notifs-row textarea,
.icms-admin-notifs-row select,
.icms-admin-notifs-grid input,
.icms-admin-notifs-grid select {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--ink-100, #e7ebf3);
	border-radius: 10px;
	font-size: 13px;
	font-family: inherit;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.2s, box-shadow 0.2s;
	color: var(--ink-800, #142243);
}
.icms-admin-notifs-row textarea { resize: vertical; min-height: 90px; }
.icms-admin-notifs-row input:focus,
.icms-admin-notifs-row textarea:focus,
.icms-admin-notifs-row select:focus,
.icms-admin-notifs-grid input:focus,
.icms-admin-notifs-grid select:focus {
	outline: 0;
	border-color: var(--gold-500, #d4a35a);
	box-shadow: 0 0 0 4px rgba(212, 163, 90, 0.15);
}
.icms-admin-notifs-row small {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	color: var(--ink-400, #6b7794);
}
.icms-admin-notifs-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 14px;
}
.icms-admin-notifs-grid > div label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--ink-700, #1f2f54);
	margin-bottom: 5px;
}
@media (max-width: 720px) {
	.icms-admin-notifs-grid { grid-template-columns: 1fr; }
}
.icms-admin-notifs-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 16px;
}
.icms-admin-notifs-cancel,
.icms-admin-notifs-send {
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	border: 0;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	transition: all 0.2s;
}
.icms-admin-notifs-cancel {
	background: transparent;
	border: 1.5px solid var(--ink-200, #c5cdde);
	color: var(--ink-700, #1f2f54);
}
.icms-admin-notifs-cancel:hover {
	background: var(--ink-50, #f5f7fb);
	border-color: var(--ink-700, #1f2f54);
}
.icms-admin-notifs-send {
	background: #16a34a;
	color: #fff;
	box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}
.icms-admin-notifs-send:hover:not([disabled]) {
	background: #15803d;
	transform: translateY(-1px);
}
.icms-admin-notifs-send[disabled] { opacity: 0.7; cursor: not-allowed; }
.icms-admin-notifs-result {
	margin-top: 14px;
	padding: 0;
	font-size: 13px;
	min-height: 0;
}
.icms-admin-notifs-result.icms-result-ok {
	background: #f0fdf4;
	border: 1px solid #86efac;
	color: #15803d;
	padding: 10px 14px;
	border-radius: 10px;
	font-weight: 600;
}
.icms-admin-notifs-result.icms-result-err {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	padding: 10px 14px;
	border-radius: 10px;
	font-weight: 600;
}

/* Sent notifications list */
.icms-admin-notifs-list {
	display: grid;
	gap: 12px;
}
.icms-admin-notifs-loading,
.icms-admin-notifs-empty {
	padding: 24px;
	text-align: center;
	color: var(--ink-400, #6b7794);
	font-size: 13px;
	background: var(--surface, #faf7f2);
	border-radius: 12px;
}
.icms-admin-notif-row {
	background: var(--surface, #faf7f2);
	border: 1px solid var(--ink-100, #e7ebf3);
	border-left: 4px solid var(--gold-500, #d4a35a);
	border-radius: 12px;
	padding: 14px 16px;
}
.icms-admin-notif-row.icms-notif-item--success      { border-left-color: #16a34a; }
.icms-admin-notif-row.icms-notif-item--warning      { border-left-color: #ea580c; }
.icms-admin-notif-row.icms-notif-item--announcement { border-left-color: #9333ea; }
.icms-admin-notif-row.icms-notif-item--info         { border-left-color: #2563eb; }
.icms-admin-notif-meta {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 6px;
}
.icms-admin-notif-type {
	font-family: var(--font-mono, monospace);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
	background: var(--ink-900, #0a1228);
	color: var(--gold-400, #e3bd83);
	padding: 3px 8px;
	border-radius: 4px;
}
.icms-admin-notif-time {
	font-size: 11px;
	color: var(--ink-400, #6b7794);
	font-family: var(--font-mono, monospace);
}
.icms-admin-notif-title {
	font-weight: 700;
	color: var(--ink-900, #0a1228);
	margin-bottom: 4px;
	font-size: 14px;
}
.icms-admin-notif-body {
	font-size: 13px;
	color: var(--ink-600, #2d4068);
	line-height: 1.5;
	margin-bottom: 10px;
	white-space: pre-wrap;
}
.icms-admin-notif-foot {
	display: flex;
	gap: 14px;
	align-items: center;
	font-size: 11px;
	color: var(--ink-500, #485776);
	flex-wrap: wrap;
}
.icms-admin-notif-foot i { margin-right: 4px; }
.icms-admin-notif-foot > span { display: inline-flex; align-items: center; }
.icms-admin-notif-del {
	margin-left: auto;
	background: transparent;
	border: 1px solid var(--ink-200, #c5cdde);
	color: var(--ink-500, #485776);
	width: 30px;
	height: 30px;
	border-radius: 7px;
	cursor: pointer;
	font-size: 11px;
	display: grid;
	place-items: center;
	transition: all 0.2s;
}
.icms-admin-notif-del:hover {
	background: #fef2f2;
	border-color: #dc2626;
	color: #dc2626;
}

/* ── Library / My Documents — locked state badge ───────────── */
.icms-doc-locked,
.icms-doc-row[data-download-locked="1"] {
	position: relative;
}
.icms-doc-lock-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: linear-gradient(135deg, var(--gold-100, #fbf2e3), var(--gold-200, #f7e7cf));
	color: var(--gold-700, #946b29);
	border: 1px solid var(--gold-300, #efd4ae);
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	margin-left: 8px;
	transition: all 0.2s;
}
.icms-doc-lock-badge:hover {
	background: var(--gold-500, #d4a35a);
	color: var(--ink-900, #0a1228);
	transform: translateY(-1px);
}
.icms-doc-lock-badge i { font-size: 10px; }
.icms-doc-window-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--ink-50, #f5f7fb);
	color: var(--ink-500, #485776);
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 600;
	font-family: var(--font-mono, monospace);
	letter-spacing: 0.02em;
}
.icms-doc-window-pill.expiring {
	background: #fff7ed;
	color: #c2410c;
}

/* Mobile refinements */
@media (max-width: 600px) {
	.icms-notif-panel {
		width: calc(100vw - 16px);
	}
	.icms-admin-notifs { padding: 16px; }
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE HEADER PILLS — collapse labels on small screens
   so bell, credits, docs, avatar, sign out all fit comfortably.
   ════════════════════════════════════════════════════════════════ */

/* Tablet: shrink padding + smaller font */
@media (max-width: 900px) {
	.icms-app-header .header-right {
		gap: 6px !important;
	}
	.icms-app-header .quota-pill,
	.icms-app-header .icms-doc-quota-pill {
		padding: 6px 12px !important;
		font-size: 12px !important;
	}
	.icms-app-header .user-pill {
		padding: 4px 10px 4px 6px !important;
	}
	.icms-app-header .user-pill-email {
		display: none !important;
	}
	.icms-app-header .hbtn-signout {
		padding: 6px 12px !important;
	}
}

/* Phone: collapse to icon-only with tooltips */
@media (max-width: 640px) {
	.icms-app-header {
		padding: 10px 12px !important;
	}
	.icms-app-header .header-spacer { display: none !important; }
	.icms-app-header .logo-icon-badge.icms-app-mark {
		width: 36px !important;
		height: 36px !important;
		font-size: 18px !important;
		border-radius: 9px !important;
	}
	.icms-app-header .logo-title-main {
		font-size: 1rem !important;
	}
	/* Notification bell — icon only, no badge text overflow */
	.icms-app-header .icms-notif-btn {
		width: 34px !important;
		height: 34px !important;
		font-size: 13px !important;
	}
	.icms-app-header .icms-notif-badge {
		font-size: 9px !important;
		min-width: 16px !important;
		height: 16px !important;
	}
	/* Credit pill: icon + number only, "Credits:" label hidden */
	.icms-app-header .quota-pill {
		padding: 6px 10px !important;
		gap: 4px !important;
	}
	.icms-app-header .quota-pill > i {
		font-size: 13px !important;
	}
	.icms-app-header .quota-pill > span {
		display: inline-flex;
		align-items: center;
	}
	/* Hide the "Credits:" / "Docs:" text node but keep the <strong> count visible */
	.icms-app-header .quota-pill > span {
		font-size: 0 !important;
		color: transparent !important;
	}
	.icms-app-header .quota-pill > span > strong {
		font-size: 13px !important;
		color: var(--gold-400, #e3bd83) !important;
	}
	.icms-app-header .quota-pill .icms-quota-plus {
		margin-left: 4px !important;
		font-size: 12px !important;
	}
	.icms-app-header .quota-pill .icms-quota-plus i {
		font-size: 12px !important;
		color: var(--gold-400, #e3bd83) !important;
	}
	/* User pill: avatar + initials only, name hidden */
	.icms-app-header .user-pill {
		padding: 3px !important;
		border-radius: 50% !important;
		width: 38px;
		height: 38px;
		justify-content: center !important;
	}
	.icms-app-header .user-pill-info {
		display: none !important;
	}
	.icms-app-header .user-pill .icms-avatar-initials,
	.icms-app-header .user-pill img {
		width: 30px !important;
		height: 30px !important;
		font-size: 12px !important;
	}
	/* Sign out: icon only */
	.icms-app-header .hbtn-signout {
		padding: 0 !important;
		width: 34px !important;
		height: 34px !important;
		justify-content: center !important;
		border-radius: 50% !important;
	}
	.icms-app-header .hbtn-signout .signout-label {
		display: none !important;
	}
	/* Mobile notification panel — full-width minus margins */
	.icms-notif-panel {
		width: calc(100vw - 16px) !important;
		max-width: none !important;
	}
}

/* Library nav pills: also responsive */
@media (max-width: 480px) {
	.icms-libnav-btn {
		font-size: 11px !important;
		padding: 6px 12px !important;
	}
	.icms-libnav-btn span {
		display: none !important;
	}
	/* Just keep icon + days indicator */
}

/* Topbar download bar (injected by ai-extract.js) — wrap nicely */
@media (max-width: 720px) {
	#topDownloadBar {
		padding: 10px 12px !important;
	}
	#topDownloadBar > div:first-child {
		font-size: 12px !important;
		flex: 1 1 100% !important;
		text-align: center;
		margin-bottom: 4px;
	}
	#topDownloadBar button {
		padding: 6px 12px !important;
		font-size: 11px !important;
	}
}


/* ════════════════════════════════════════════════════════════════════
   AUTH MODAL — MOVED to css/auth-modal.css on 2026-08-03
   ════════════════════════════════════════════════════════════════════
   ~430 lines of `.icms-auth-*` rules lived here at class-level
   specificity, which is why css/v4.css's `#authModal .modal-box{…}`
   block (ID, 1,1,0) beat them and rendered the edge-to-edge card inside
   a 36px white frame. The modal is now a split panel owned by
   css/auth-modal.css, which is ID-scoped and linked LAST.

   The `.icms-disabled-*` account-disabled card moved with it — it is
   rendered into #loginErr, so it belongs with the modal.

   What follows is deliberately LEFT here: .icms-user-status-pill and
   tr.icms-user-row-disabled style the ADMIN USERS TABLE, not the modal,
   and were only interleaved with the auth block by history. */

/* ── Admin users table: disabled-account marker ──────────────────────
   Lives in the Name cell (see buildAdminUserRow) so the table keeps its
   ten columns. */
.icms-user-status-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 7px;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	white-space: nowrap;
	vertical-align: middle;
}
.icms-user-status-pill.is-disabled {
	background: #fee2e2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}
tr.icms-user-row-disabled > td { background: #fff7f7; }

