/* =====================================================================
   Noticeboard module - shared styles for the three pages
     c_a_notice_board.jsp   (admin manage)
     c_u_notice_board.jsp   (user manage)
     c_u_notice_view.jsp    (occupant read-only feed)
   Every rule is namespaced .nb-* / #nb* so nothing leaks into the theme.
   ===================================================================== */

:root {
	--nb-brand:       #059142;
	--nb-brand-dark:  #04702f;
	--nb-brand-soft:  rgba(5,145,66,.10);
	--nb-brand-soft2: rgba(5,145,66,.18);

	--nb-urgent:      #d64545;
	--nb-urgent-soft: #fdeceb;
	--nb-important:   #c2790b;
	--nb-important-soft: #fdf3e0;
	--nb-normal:      #3f7fbf;
	--nb-normal-soft: #eaf2fa;

	--nb-ink:    #10221a;
	--nb-body:   #3d4a52;
	--nb-muted:  #77848d;
	--nb-line:   #e4e9ec;
	--nb-line2:  #eef2f4;
	--nb-card:   #ffffff;
	--nb-bg:     #f5f7f6;

	--nb-r:   14px;
	--nb-r-s: 10px;
	--nb-shadow:  0 1px 2px rgba(16,34,26,.06), 0 6px 20px rgba(16,34,26,.05);
	--nb-shadow2: 0 12px 40px rgba(16,34,26,.14);
}

#main-container .content { background: var(--nb-bg); }
.nb-wrap { max-width: 1560px; margin: 0 auto; }
.nb-wrap *, .nb-modal-shell * { box-sizing: border-box; }

/* ---------------------------------------------------------- module nav
   Pill links between the module's pages. Admin pages render it inline;
   the user pages get it from user/u_notice_nav.jsp. */
.nb-modnav {
	display: flex; gap: 6px; flex-wrap: wrap; background: #fff; border: 1px solid var(--nb-line);
	border-radius: 999px; padding: 5px; box-shadow: var(--nb-shadow); margin-bottom: 16px;
}
.nb-modnav a {
	display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
	font-size: 13px; font-weight: 600; color: #5c6a72; text-decoration: none;
}
.nb-modnav a:hover { background: #eff4f1; color: var(--nb-brand-dark); text-decoration: none; }
.nb-modnav a.active {
	background: linear-gradient(135deg, var(--nb-brand), #2fae6b); color: #fff;
	box-shadow: 0 2px 8px rgba(5,145,66,.28);
}

/* ---------------------------------------------------------- hero */
.nb-hero {
	display: flex; align-items: flex-end; justify-content: space-between;
	gap: 18px; flex-wrap: wrap; margin-bottom: 18px;
}
.nb-hero-l { display: flex; align-items: center; gap: 14px; }
.nb-hero-ico {
	width: 46px; height: 46px; border-radius: 13px; flex: 0 0 46px;
	background: linear-gradient(140deg, var(--nb-brand) 0%, #2fae6b 100%);
	color: #fff; display: inline-flex; align-items: center; justify-content: center;
	font-size: 19px; box-shadow: 0 6px 18px rgba(5,145,66,.28);
}
.nb-hero h2 { margin: 0; font-size: 21px; font-weight: 800; color: var(--nb-ink); letter-spacing: -.2px; }
.nb-hero p  { margin: 3px 0 0; font-size: 12.5px; color: var(--nb-muted); }

/* ---------------------------------------------------------- buttons */
.nb-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	padding: 10px 16px; border-radius: var(--nb-r-s); border: 1px solid transparent;
	font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer;
	transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
	white-space: nowrap; font-family: inherit;
}
.nb-btn i { font-size: 12px; }
.nb-btn:focus { outline: 2px solid var(--nb-brand-soft2); outline-offset: 1px; }
.nb-btn[disabled] { opacity: .55; cursor: not-allowed; }
.nb-btn-primary { background: var(--nb-brand); color: #fff; box-shadow: 0 4px 14px rgba(5,145,66,.24); }
.nb-btn-primary:hover:not([disabled]) { background: var(--nb-brand-dark); color: #fff; }
.nb-btn-ghost { background: #fff; color: var(--nb-body); border-color: var(--nb-line); }
.nb-btn-ghost:hover:not([disabled]) { background: #f4f7f5; color: var(--nb-ink); }
.nb-btn-danger { background: var(--nb-urgent); color: #fff; }
.nb-btn-danger:hover:not([disabled]) { background: #bb3838; color: #fff; }
.nb-btn-sm { padding: 7px 12px; font-size: 12px; }

/* icon-only row actions on a card footer */
.nb-ibtn {
	width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--nb-line);
	background: #fff; color: var(--nb-muted); cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 12.5px; transition: all .15s; padding: 0;
}
.nb-ibtn:hover { background: #f2f6f3; color: var(--nb-brand-dark); border-color: #cfe0d5; }
.nb-ibtn.nb-ibtn-danger:hover { background: var(--nb-urgent-soft); color: var(--nb-urgent); border-color: #f0c4c2; }

/* ---------------------------------------------------------- stat tiles */
.nb-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.nb-stat {
	background: var(--nb-card); border: 1px solid var(--nb-line); border-radius: var(--nb-r);
	padding: 14px 15px; box-shadow: var(--nb-shadow); position: relative; overflow: hidden;
}
.nb-stat:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--nb-line); }
.nb-stat.is-active:before   { background: var(--nb-brand); }
.nb-stat.is-expiring:before { background: var(--nb-important); }
.nb-stat.is-expired:before  { background: #98a4ac; }
.nb-stat.is-stopped:before  { background: var(--nb-normal); }
.nb-stat.is-high:before     { background: var(--nb-urgent); }
.nb-stat-k { font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--nb-muted); }
.nb-stat-v { font-size: 26px; font-weight: 800; color: var(--nb-ink); line-height: 1.15; margin: 4px 0 1px; }
.nb-stat-s { font-size: 11.5px; color: var(--nb-muted); }

/* ---------------------------------------------------------- toolbar */
.nb-panel {
	background: var(--nb-card); border: 1px solid var(--nb-line);
	border-radius: var(--nb-r); box-shadow: var(--nb-shadow); overflow: hidden;
}
.nb-panel-head {
	display: flex; align-items: center; justify-content: space-between; gap: 14px;
	padding: 14px 18px; border-bottom: 1px solid var(--nb-line2); flex-wrap: wrap;
}
.nb-panel-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--nb-ink); display: flex; align-items: center; gap: 9px; }
.nb-panel-head h3 span { font-weight: 500; color: var(--nb-muted); font-size: 12px; }
.nb-panel-body { padding: 18px; }

.nb-search { position: relative; flex: 1 1 260px; max-width: 460px; }
.nb-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #9aa6ad; font-size: 13px; }
.nb-search input {
	width: 100%; padding: 10px 13px 10px 35px; border: 1px solid var(--nb-line);
	border-radius: var(--nb-r-s); font-size: 13px; color: var(--nb-body); background: #fbfcfc;
	font-family: inherit;
}
.nb-search input:focus { outline: none; border-color: var(--nb-brand); background: #fff; box-shadow: 0 0 0 3px var(--nb-brand-soft); }

.nb-segs { display: inline-flex; gap: 3px; background: #f0f3f1; border: 1px solid var(--nb-line); border-radius: 999px; padding: 4px; flex-wrap: wrap; }
.nb-seg {
	border: 0; background: transparent; border-radius: 999px; padding: 7px 14px;
	font-size: 12.5px; font-weight: 600; color: #5c6a72; cursor: pointer; transition: all .15s;
	font-family: inherit; line-height: 1;
}
.nb-seg:hover { color: var(--nb-brand-dark); }
.nb-seg.active { background: #fff; color: var(--nb-brand-dark); box-shadow: 0 1px 4px rgba(16,34,26,.14); }

/* ---------------------------------------------------------- notice cards */
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.nb-card {
	background: var(--nb-card); border: 1px solid var(--nb-line); border-radius: var(--nb-r);
	overflow: hidden; display: flex; flex-direction: column; position: relative;
	transition: box-shadow .18s, transform .18s, border-color .18s;
}
.nb-card:hover { box-shadow: var(--nb-shadow2); transform: translateY(-2px); border-color: #d7e2da; }
.nb-card:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; z-index: 2; }
.nb-card.p-URGENT:before    { background: var(--nb-urgent); }
.nb-card.p-IMPORTANT:before { background: var(--nb-important); }
.nb-card.p-NORMAL:before    { background: var(--nb-brand); }
.nb-card.is-dim { opacity: .72; }
.nb-card.is-dim:hover { opacity: 1; }

/* image strip */
.nb-media { position: relative; height: 168px; background: #eef2ef; display: block; }
.nb-media-grid { display: grid; height: 100%; gap: 2px; }
.nb-media-grid.n1 { grid-template-columns: 1fr; }
.nb-media-grid.n2 { grid-template-columns: 1fr 1fr; }
.nb-media-grid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.nb-media-grid.n3 > *:first-child { grid-row: span 2; }
.nb-media-grid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.nb-media-grid img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; background: #e7ece9; }
.nb-media-more {
	position: absolute; right: 10px; bottom: 10px; background: rgba(16,34,26,.78); color: #fff;
	border-radius: 999px; padding: 4px 11px; font-size: 11px; font-weight: 700;
}
.nb-media-none {
	height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: 7px; color: #a6b2ac; font-size: 12px;
	background: repeating-linear-gradient(135deg, #f1f5f2, #f1f5f2 12px, #edf2ee 12px, #edf2ee 24px);
}
.nb-media-none i { font-size: 22px; opacity: .65; }

.nb-card-body { padding: 15px 16px 12px 18px; flex: 1 1 auto; }
.nb-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.nb-card-title {
	margin: 0; font-size: 14.5px; font-weight: 700; color: var(--nb-ink); line-height: 1.4;
	flex: 1 1 auto; word-break: break-word;
}
.nb-card-text {
	margin: 8px 0 0; font-size: 12.8px; line-height: 1.62; color: var(--nb-body);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
	white-space: pre-wrap; word-break: break-word;
}
.nb-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }

/* badges */
.nb-badge {
	display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
	padding: 4px 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
	text-transform: uppercase; white-space: nowrap;
}
.nb-b-URGENT    { background: var(--nb-urgent-soft); color: var(--nb-urgent); }
.nb-b-IMPORTANT { background: var(--nb-important-soft); color: var(--nb-important); }
.nb-b-NORMAL    { background: var(--nb-normal-soft); color: var(--nb-normal); }
.nb-b-ACTIVE    { background: var(--nb-brand-soft); color: var(--nb-brand-dark); }
.nb-b-EXPIRING  { background: var(--nb-important-soft); color: var(--nb-important); }
.nb-b-EXPIRED   { background: #eef1f3; color: #6c7880; }
.nb-b-STOPPED   { background: var(--nb-normal-soft); color: var(--nb-normal); }
.nb-b-DELETED   { background: var(--nb-urgent-soft); color: var(--nb-urgent); }
.nb-b-NEW       { background: #fdf3d6; color: #9a6206; }

/* Right-aligned badge column: priority over lifecycle state over NEW.
   Used by the manage cards (.nb-badge-stack) and the occupant feed (.nb-post-badges). */
.nb-badge-stack, .nb-post-badges {
	display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: 0 0 auto;
}

.nb-tag {
	display: inline-flex; align-items: center; gap: 5px; border-radius: 7px; padding: 4px 9px;
	font-size: 11px; font-weight: 600; background: #f2f5f3; color: #5c6a72; white-space: nowrap;
	border: 1px solid var(--nb-line2);
}
.nb-tag i { font-size: 10.5px; opacity: .8; }
.nb-tag.is-link { background: var(--nb-brand-soft); color: var(--nb-brand-dark); border-color: transparent; }

.nb-card-foot {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	padding: 11px 16px 12px 18px; border-top: 1px solid var(--nb-line2); background: #fcfdfc; flex-wrap: wrap;
}
.nb-card-foot .nb-when { font-size: 11px; color: var(--nb-muted); line-height: 1.5; }
.nb-card-acts { display: flex; gap: 6px; }

/* ---------------------------------------------------------- empty / loading */
.nb-empty { padding: 58px 20px; text-align: center; color: var(--nb-muted); }
.nb-empty-ic {
	width: 60px; height: 60px; border-radius: 18px; background: var(--nb-brand-soft);
	color: var(--nb-brand); display: inline-flex; align-items: center; justify-content: center;
	font-size: 24px; margin-bottom: 14px;
}
.nb-empty h4 { margin: 0 0 5px; font-size: 15px; font-weight: 700; color: var(--nb-ink); }
.nb-empty p { margin: 0 auto; font-size: 12.5px; max-width: 380px; line-height: 1.6; }
.nb-empty .nb-btn { margin-top: 16px; }

.nb-loading { padding: 56px 20px; text-align: center; color: var(--nb-muted); font-size: 13px; }
.nb-spin {
	width: 26px; height: 26px; border: 3px solid var(--nb-brand-soft2); border-top-color: var(--nb-brand);
	border-radius: 50%; animation: nbSpin .7s linear infinite; margin: 0 auto 12px;
}
@keyframes nbSpin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- modal */
.nb-modal-shell {
	position: fixed; inset: 0; background: rgba(12,26,20,.45); z-index: 1400;
	display: none; align-items: flex-start; justify-content: center; padding: 34px 16px;
	overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.nb-modal-shell.open { display: flex; }
.nb-modal {
	background: #fff; border-radius: 18px; width: 100%; max-width: 680px;
	box-shadow: 0 24px 70px rgba(8,20,15,.32); animation: nbPop .2s ease; margin: auto;
}
.nb-modal.sm { max-width: 440px; }
@keyframes nbPop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.nb-modal-head {
	display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
	padding: 20px 24px 16px; border-bottom: 1px solid var(--nb-line2);
}
.nb-modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--nb-ink); }
.nb-modal-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--nb-muted); }
.nb-x {
	border: 0; background: #f2f5f3; color: var(--nb-muted); width: 30px; height: 30px;
	border-radius: 9px; cursor: pointer; font-size: 13px; flex: 0 0 30px;
}
.nb-x:hover { background: #e7ece9; color: var(--nb-ink); }
.nb-modal-body { padding: 20px 24px; }
.nb-modal-foot {
	display: flex; justify-content: flex-end; gap: 10px; padding: 15px 24px 20px;
	border-top: 1px solid var(--nb-line2);
}

/* ---------------------------------------------------------- form */
.nb-field { margin-bottom: 17px; }
.nb-field:last-child { margin-bottom: 0; }
.nb-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--nb-ink); margin-bottom: 7px; }
.nb-label span { font-weight: 500; color: var(--nb-muted); }
.nb-label .req { color: var(--nb-urgent); }
.nb-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--nb-muted); line-height: 1.5; }

.nb-input, .nb-select, .nb-textarea {
	width: 100%; border: 1px solid var(--nb-line); border-radius: var(--nb-r-s);
	padding: 11px 13px; font-size: 13px; color: var(--nb-body); background: #fbfcfc;
	font-family: inherit; transition: border-color .15s, box-shadow .15s, background .15s;
}
.nb-textarea { min-height: 108px; resize: vertical; line-height: 1.6; }
.nb-input:focus, .nb-select:focus, .nb-textarea:focus {
	outline: none; border-color: var(--nb-brand); background: #fff; box-shadow: 0 0 0 3px var(--nb-brand-soft);
}
.nb-input.err, .nb-select.err, .nb-textarea.err { border-color: var(--nb-urgent); background: #fffafa; }
.nb-err { display: none; margin: 6px 0 0; font-size: 11.5px; color: var(--nb-urgent); font-weight: 600; }
.nb-err.show { display: block; }

/* priority segmented control */
.nb-prio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nb-prio button {
	border: 1px solid var(--nb-line); background: #fbfcfc; border-radius: var(--nb-r-s);
	padding: 11px 8px; font-size: 12.5px; font-weight: 700; color: #66737b; cursor: pointer;
	display: flex; align-items: center; justify-content: center; gap: 7px; transition: all .15s;
	font-family: inherit;
}
.nb-prio button .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .55; }
.nb-prio button:hover { background: #f4f7f5; }
.nb-prio button.on { color: #fff; border-color: transparent; }
.nb-prio button.on .dot { background: #fff; opacity: 1; }
.nb-prio button[data-p="NORMAL"].on    { background: var(--nb-brand); }
.nb-prio button[data-p="IMPORTANT"].on { background: var(--nb-important); }
.nb-prio button[data-p="URGENT"].on    { background: var(--nb-urgent); }

/* drop zones */
.nb-drop {
	border: 1.5px dashed #cdd8d2; border-radius: var(--nb-r-s); background: #fbfdfb;
	padding: 22px 16px; text-align: center; cursor: pointer; transition: all .15s; color: var(--nb-muted);
}
.nb-drop:hover, .nb-drop.over { border-color: var(--nb-brand); background: var(--nb-brand-soft); color: var(--nb-brand-dark); }
.nb-drop i { display: block; font-size: 20px; margin-bottom: 8px; opacity: .8; }
.nb-drop b { display: block; font-size: 12.8px; font-weight: 700; color: var(--nb-ink); }
.nb-drop small { font-size: 11.5px; }
.nb-drop.full { opacity: .5; pointer-events: none; }

.nb-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.nb-thumb {
	position: relative; width: 84px; height: 84px; border-radius: var(--nb-r-s);
	overflow: hidden; border: 1px solid var(--nb-line); background: #f1f4f2;
}
.nb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nb-thumb button {
	position: absolute; top: 4px; right: 4px; width: 21px; height: 21px; border-radius: 50%;
	border: 0; background: rgba(16,34,26,.72); color: #fff; font-size: 10px; cursor: pointer;
	display: flex; align-items: center; justify-content: center; padding: 0;
}
.nb-thumb button:hover { background: var(--nb-urgent); }

.nb-files { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.nb-file {
	display: flex; align-items: center; gap: 11px; padding: 9px 11px;
	border: 1px solid var(--nb-line); border-radius: var(--nb-r-s); background: #fbfcfc;
}
.nb-file-ic {
	width: 32px; height: 32px; border-radius: 8px; flex: 0 0 32px; display: flex;
	align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
	background: var(--nb-brand-soft); color: var(--nb-brand-dark);
}
.nb-file-ic.pdf { background: var(--nb-urgent-soft); color: var(--nb-urgent); }
.nb-file-ic.doc { background: var(--nb-normal-soft); color: var(--nb-normal); }
.nb-file-ic.xls { background: #e7f5ec; color: #12793f; }
.nb-file-m { flex: 1 1 auto; min-width: 0; }
.nb-file-m b { display: block; font-size: 12.5px; font-weight: 600; color: var(--nb-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-file-m small { font-size: 11px; color: var(--nb-muted); }
.nb-file a, .nb-file button {
	border: 0; background: transparent; color: var(--nb-muted); cursor: pointer;
	width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
	font-size: 12px; flex: 0 0 28px; text-decoration: none;
}
.nb-file a:hover { background: var(--nb-brand-soft); color: var(--nb-brand-dark); }
.nb-file button:hover { background: var(--nb-urgent-soft); color: var(--nb-urgent); }

/* optional-extras disclosure */
.nb-more-toggle {
	border: 0; background: transparent; color: var(--nb-brand-dark); font-size: 12.8px; font-weight: 700;
	cursor: pointer; padding: 4px 0; display: inline-flex; align-items: center; gap: 8px; font-family: inherit;
}
.nb-more-toggle:hover { color: var(--nb-brand); }
.nb-more-body { display: none; margin-top: 14px; padding-top: 16px; border-top: 1px dashed var(--nb-line); }
.nb-more-body.open { display: block; }

/* ---------------------------------------------------------- toast */
.nb-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1600; display: flex; flex-direction: column; gap: 9px; }
.nb-toast {
	background: #17251f; color: #fff; border-radius: var(--nb-r-s); padding: 12px 16px;
	font-size: 12.8px; font-weight: 600; box-shadow: 0 12px 34px rgba(8,20,15,.3);
	display: flex; align-items: center; gap: 10px; animation: nbSlide .2s ease; max-width: 380px;
}
@keyframes nbSlide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.nb-toast.ok  { background: var(--nb-brand-dark); }
.nb-toast.err { background: #a83232; }
.nb-toast.warn { background: #9a6206; }

/* ---------------------------------------------------------- lightbox */
.nb-lightbox {
	position: fixed; inset: 0; background: rgba(8,16,12,.9); z-index: 1700;
	display: none; align-items: center; justify-content: center; padding: 28px;
}
.nb-lightbox.open { display: flex; }
.nb-lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.nb-lightbox .nb-lb-x {
	position: absolute; top: 20px; right: 24px; width: 38px; height: 38px; border-radius: 50%;
	border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 15px; cursor: pointer;
}
.nb-lightbox .nb-lb-x:hover { background: rgba(255,255,255,.26); }

/* ---------------------------------------------------------- occupant feed */
.nb-feed { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.nb-feed-head { max-width: 780px; margin: 0 auto 18px; }
.nb-feed-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 800; color: var(--nb-ink); }
.nb-feed-head h2 .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--nb-brand); box-shadow: 0 0 0 4px var(--nb-brand-soft); }
.nb-feed-head p { margin: 5px 0 0; font-size: 12.5px; color: var(--nb-muted); }

.nb-post {
	background: var(--nb-card); border: 1px solid var(--nb-line); border-radius: var(--nb-r);
	box-shadow: var(--nb-shadow); overflow: hidden; position: relative;
}
.nb-post:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.nb-post.p-URGENT:before    { background: var(--nb-urgent); }
.nb-post.p-IMPORTANT:before { background: var(--nb-important); }
.nb-post.p-NORMAL:before    { background: var(--nb-brand); }
.nb-post-in { padding: 16px 18px 16px 21px; }
.nb-post-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.nb-post-top h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--nb-ink); line-height: 1.45; word-break: break-word; }
.nb-post-by { margin: 4px 0 0; font-size: 11.5px; color: var(--nb-muted); }
.nb-post-text { margin: 10px 0 0; font-size: 13.2px; line-height: 1.68; color: var(--nb-body); white-space: pre-wrap; word-break: break-word; }

.nb-post-imgs { display: grid; gap: 8px; margin-top: 13px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.nb-post-imgs img {
	width: 100%; height: 170px; object-fit: cover; border-radius: var(--nb-r-s);
	border: 1px solid var(--nb-line2); cursor: zoom-in; background: #f0f3f1; display: block;
}
.nb-post-docs { margin-top: 13px; display: flex; flex-direction: column; gap: 8px; }
.nb-post-link {
	margin-top: 13px; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
	border-radius: var(--nb-r-s); background: var(--nb-brand-soft); color: var(--nb-brand-dark);
	font-size: 12.5px; font-weight: 700; text-decoration: none;
}
.nb-post-link:hover { background: var(--nb-brand-soft2); color: var(--nb-brand-dark); text-decoration: none; }

.nb-post-foot {
	display: flex; align-items: center; gap: 8px; margin: 14px -18px -16px -21px;
	padding: 10px 18px 10px 21px; border-top: 1px solid var(--nb-line2);
	font-size: 11.5px; font-weight: 600; color: var(--nb-muted); background: #fbfcfc; flex-wrap: wrap;
}
.nb-post-foot.soon { background: var(--nb-important-soft); color: var(--nb-important); border-top-color: #f3e2c2; }

/* ---------------------------------------------------------- activity log (admin only) */
.nb-log-wrap { max-height: 70vh; overflow: auto; }
.nb-log { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.nb-log th {
	position: sticky; top: 0; z-index: 1; background: #f7faf8; color: #48586a; text-align: left;
	font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
	padding: 11px 14px; border-bottom: 1px solid var(--nb-line); white-space: nowrap;
}
.nb-log td { padding: 11px 14px; border-bottom: 1px solid var(--nb-line2); color: var(--nb-body); vertical-align: top; }
.nb-log tr:last-child td { border-bottom: 0; }
.nb-log tbody tr:hover td { background: #f9fbfa; }
.nb-log .nb-log-when { white-space: nowrap; color: var(--nb-muted); font-size: 11.5px; }
.nb-log .nb-log-who b { display: block; font-weight: 700; color: var(--nb-ink); }
.nb-log .nb-log-who small { color: #8a97a2; font-size: 11px; }
.nb-log .nb-log-target { font-weight: 600; color: var(--nb-ink); max-width: 320px; word-break: break-word; }
.nb-log .nb-log-remarks { max-width: 380px; word-break: break-word; line-height: 1.55; }
.nb-log .nb-log-device { white-space: nowrap; color: var(--nb-muted); font-size: 11.5px; }

/* one badge per action verb */
.nb-a { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; white-space: nowrap; }
.nb-a-ADD              { background: #e4f5e9; color: #177a3c; }
.nb-a-EDIT             { background: #e7eefb; color: #3556b0; }
.nb-a-STOP             { background: #eef1f3; color: #5b6a73; }
.nb-a-RESUME           { background: #e4f5e9; color: #177a3c; }
.nb-a-DELETE           { background: #fdece9; color: #b0392c; }
.nb-a-RESTORE          { background: #fdf3d6; color: #9a6206; }
.nb-a-PERMANENT_DELETE { background: #b0392c; color: #fff; }

.nb-who-admin { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--nb-brand-soft); color: var(--nb-brand-dark); font-size: 10.5px; font-weight: 700; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1280px) { .nb-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
	.nb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.nb-grid { grid-template-columns: 1fr; }
	.nb-hero { align-items: flex-start; }
	.nb-hero .nb-btn { width: 100%; }
	.nb-panel-body { padding: 14px; }
	.nb-modal-shell { padding: 0; }
	.nb-modal { border-radius: 0; min-height: 100%; max-width: none; }
	.nb-modal-head, .nb-modal-body, .nb-modal-foot { padding-left: 16px; padding-right: 16px; }
	.nb-toasts { left: 14px; right: 14px; bottom: 14px; }
	.nb-toast { max-width: none; }
	.nb-post-imgs { grid-template-columns: 1fr 1fr; }
	.nb-post-imgs img { height: 130px; }
}
