/* ==========================================================================
BIHAR SEVA LINKS — Light Civic Directory & Admin Portal Stylesheet
========================================================================== */

:root {
--bg-page: #f3f6fa;
--bg-surface: #ffffff;
--bg-subtle: #f8fafc;
--bg-hover: #eff6ff;

--navy-brand: #0f2942;
--navy-dark: #091b2d;
--saffron-accent: #d97706;
--saffron-soft: #fef3c7;

--blue-primary: #1d4ed8;
--blue-primary-hover: #1e40af;
--blue-soft: #dbeafe;
--blue-border: #93c5fd;

--text-primary: #0f172a;
--text-secondary: #334155;
--text-muted: #64748b;

--border-light: #e2e8f0;
--border-medium: #cbd5e1;

--status-online-bg: #dcfce7;
--status-online-text: #15803d;
--status-online-dot: #16a34a;

--status-degraded-bg: #fef3c7;
--status-degraded-text: #b45309;
--status-degraded-dot: #f59e0b;

--status-offline-bg: #fee2e2;
--status-offline-text: #b91c1c;
--status-offline-dot: #dc2626;

--status-unknown-bg: #f1f5f9;
--status-unknown-text: #475569;
--status-unknown-dot: #94a3b8;

--shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
--shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
--shadow-md: 0 6px 16px -2px rgba(15, 23, 42, 0.1), 0 2px 6px -1px rgba(15, 23, 42, 0.05);
--shadow-lg: 0 14px 28px -4px rgba(15, 23, 42, 0.16);

--radius-sm: 6px;
--radius-md: 10px;
--radius-lg: 14px;
--radius-pill: 9999px;

--font-sans: 'Inter', 'Noto Sans Devanagari', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;

--top-strip-height: 36px;
--header-height: 66px;
--sidebar-width: 280px;
}

*,
*::before,
*::after {
box-sizing: border-box;
}

html {
font-size: 16px;
scroll-behavior: smooth;
-webkit-text-size-adjust: 100%;
}

body {
margin: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
background-color: var(--bg-page);
color: var(--text-primary);
font-family: var(--font-sans);
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}

a {
color: var(--blue-primary);
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

button,
input,
select,
textarea {
font-family: inherit;
font-size: inherit;
color: inherit;
}

button {
cursor: pointer;
}

[hidden] {
display: none !important;
}

.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}

:focus-visible {
outline: 2px solid var(--blue-primary);
outline-offset: 2px;
}

/* ==========================================================================

1. Top Brand Strip
   ========================================================================== */

.top-brand-strip {
min-height: var(--top-strip-height);
background: var(--navy-brand);
color: #ffffff;
border-bottom: 2px solid var(--saffron-accent);
padding: 0.35rem 1.25rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
font-size: 0.8125rem;
}

.brand-identity {
display: flex;
align-items: center;
gap: 0.55rem;
min-width: 0;
}

.brand-dot {
width: 9px;
height: 9px;
border-radius: 50%;
background-color: var(--saffron-accent);
box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.28);
flex-shrink: 0;
}

.brand-title {
font-weight: 800;
letter-spacing: 0.05em;
color: #ffffff;
white-space: nowrap;
}

.brand-subtitle-hi {
color: #cbd5e1;
font-weight: 500;
padding-left: 0.5rem;
border-left: 1px solid rgba(255, 255, 255, 0.22);
white-space: nowrap;
}

.brand-live-meta {
display: flex;
align-items: center;
gap: 0.75rem;
}

.top-live-summary {
color: #e2e8f0;
font-size: 0.78rem;
font-weight: 500;
white-space: nowrap;
}

/* ==========================================================================
2. Sticky App Header
========================================================================== */

.app-header {
position: sticky;
top: 0;
z-index: 40;
min-height: var(--header-height);
background: var(--bg-surface);
border-bottom: 1px solid var(--border-light);
box-shadow: var(--shadow-xs);
padding: 0.6rem 1.25rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
}

.header-left {
display: flex;
align-items: center;
gap: 0.75rem;
flex-shrink: 0;
}

.sidebar-toggle-btn {
width: 38px;
height: 38px;
border-radius: var(--radius-md);
border: 1px solid var(--border-light);
background: var(--bg-subtle);
color: var(--text-primary);
font-size: 1.25rem;
font-weight: 700;
line-height: 1;
display: inline-flex;
align-items: center;
justify-content: center;
transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sidebar-toggle-btn:hover {
background: var(--bg-hover);
border-color: var(--blue-border);
color: var(--blue-primary);
}

.nav-tabs {
display: inline-flex;
align-items: center;
background: var(--bg-page);
padding: 3px;
border-radius: var(--radius-pill);
border: 1px solid var(--border-light);
gap: 2px;
}

.nav-tab-btn {
border: none;
background: transparent;
color: var(--text-secondary);
font-size: 0.875rem;
font-weight: 600;
padding: 0.38rem 0.95rem;
border-radius: var(--radius-pill);
transition: all 0.15s ease;
}

.nav-tab-btn:hover {
color: var(--text-primary);
}

.nav-tab-btn.is-active {
background: var(--blue-primary);
color: #ffffff;
box-shadow: var(--shadow-xs);
}

/* Centered Pill Search */
.header-search-wrap {
position: relative;
flex: 1 1 480px;
max-width: 620px;
display: flex;
align-items: center;
}

.search-icon {
position: absolute;
left: 1rem;
font-size: 0.9rem;
color: var(--text-muted);
pointer-events: none;
}

.global-search-input {
width: 100%;
height: 42px;
padding: 0 2.6rem 0 2.65rem;
border-radius: var(--radius-pill);
border: 1.5px solid var(--border-medium);
background: var(--bg-subtle);
color: var(--text-primary);
font-size: 0.9rem;
transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.global-search-input::placeholder {
color: var(--text-muted);
}

.global-search-input:hover {
border-color: #94a3b8;
background: var(--bg-surface);
}

.global-search-input:focus {
outline: none;
background: var(--bg-surface);
border-color: var(--blue-primary);
box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.14);
}

.global-search-input::-webkit-search-cancel-button {
-webkit-appearance: none;
appearance: none;
}

.clear-search-btn {
position: absolute;
right: 0.65rem;
width: 26px;
height: 26px;
border-radius: 50%;
border: none;
background: #e2e8f0;
color: var(--text-secondary);
font-size: 0.75rem;
display: inline-flex;
align-items: center;
justify-content: center;
transition: background-color 0.15s ease;
}

.clear-search-btn:hover {
background: #cbd5e1;
color: var(--text-primary);
}

/* Right Utility Circle Buttons */
.header-right {
display: flex;
align-items: center;
gap: 0.6rem;
flex-shrink: 0;
}

.circle-action-btn {
width: 40px;
height: 40px;
border-radius: 50%;
border: 1px solid var(--border-medium);
background: var(--bg-surface);
color: var(--text-primary);
display: inline-flex;
align-items: center;
justify-content: center;
font-weight: 700;
font-size: 0.875rem;
text-decoration: none;
box-shadow: var(--shadow-xs);
transition: all 0.15s ease;
}

.circle-action-btn:hover {
text-decoration: none;
background: var(--bg-hover);
border-color: var(--blue-primary);
color: var(--blue-primary);
transform: translateY(-1px);
}

.circle-action-btn.lang-btn {
background: var(--saffron-soft);
border-color: #fcd34d;
color: #92400e;
}

.circle-action-btn.lang-btn:hover {
background: #fde68a;
border-color: var(--saffron-accent);
color: #78350f;
}

/* ==========================================================================
3. Workspace Shell & Left Department Rail
========================================================================== */

.workspace-shell {
flex: 1 0 auto;
display: flex;
align-items: stretch;
position: relative;
width: 100%;
max-width: 1640px;
margin: 0 auto;
}

.sidebar-backdrop {
display: none;
}

.dept-sidebar {
width: var(--sidebar-width);
flex-shrink: 0;
background: var(--bg-surface);
border-right: 1px solid var(--border-light);
position: sticky;
top: var(--header-height);
height: calc(100vh - var(--header-height));
display: flex;
flex-direction: column;
transition: width 0.2s ease, margin-left 0.2s ease, transform 0.22s ease;
z-index: 30;
}

.dept-sidebar.is-collapsed {
width: 0;
min-width: 0;
overflow: hidden;
border-right: none;
}

.dept-sidebar-header {
padding: 0.95rem 0.95rem 0.75rem;
border-bottom: 1px solid var(--border-light);
background: var(--bg-surface);
}

.dept-sidebar-title-row {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 0.6rem;
}

.dept-sidebar-title {
margin: 0;
font-size: 0.875rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--text-secondary);
}

.dept-count-pill {
background: var(--blue-soft);
color: var(--blue-primary);
font-size: 0.75rem;
font-weight: 700;
padding: 0.12rem 0.55rem;
border-radius: var(--radius-pill);
}

.dept-filter-input {
width: 100%;
height: 34px;
padding: 0 0.75rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-medium);
background: var(--bg-subtle);
font-size: 0.8125rem;
}

.dept-filter-input:focus {
outline: none;
background: var(--bg-surface);
border-color: var(--blue-primary);
box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12);
}

.dept-list-scroll {
flex: 1 1 auto;
overflow-y: auto;
padding: 0.5rem;
}

.dept-list-scroll::-webkit-scrollbar {
width: 6px;
}

.dept-list-scroll::-webkit-scrollbar-thumb {
background: #cbd5e1;
border-radius: 999px;
}

.dept-list {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
gap: 2px;
}

.dept-item-btn {
width: 100%;
border: 1px solid transparent;
background: transparent;
border-radius: var(--radius-md);
padding: 0.52rem 0.6rem;
display: flex;
align-items: center;
gap: 0.6rem;
text-align: left;
color: var(--text-secondary);
transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.dept-item-btn:hover {
background: var(--bg-subtle);
color: var(--text-primary);
}

.dept-item-btn.is-active,
.dept-item.is-active > .dept-item-btn {
background: var(--bg-hover);
border-color: var(--blue-border);
color: var(--blue-primary);
font-weight: 600;
}

.dept-icon-badge,
.dept-icon-box {
width: 26px;
height: 26px;
border-radius: 6px;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 0.75rem;
font-weight: 700;
flex-shrink: 0;
background: #e2e8f0;
color: #334155;
}

/* Color-coded department square icon variants */
.dept-icon-box.tone-blue,
.service-icon-square.tone-blue {
background: #dbeafe;
color: #1d4ed8;
}

.dept-icon-box.tone-amber,
.service-icon-square.tone-amber {
background: #fef3c7;
color: #b45309;
}

.dept-icon-box.tone-emerald,
.service-icon-square.tone-emerald {
background: #dcfce7;
color: #15803d;
}

.dept-icon-box.tone-indigo,
.service-icon-square.tone-indigo {
background: #e0e7ff;
color: #4338ca;
}

.dept-icon-box.tone-rose,
.service-icon-square.tone-rose {
background: #ffe4e6;
color: #be123c;
}

.dept-icon-box.tone-teal,
.service-icon-square.tone-teal {
background: #ccfbf1;
color: #0f766e;
}

.dept-item-name {
  flex: 1 1 auto;
  font-size: 0.825rem;
  line-height: 1.32;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}


.dept-item-count {
font-size: 0.72rem;
font-weight: 700;
color: var(--text-muted);
background: var(--bg-page);
padding: 0.1rem 0.45rem;
border-radius: var(--radius-pill);
flex-shrink: 0;
}

.dept-item-btn.is-active .dept-item-count {
background: var(--blue-primary);
color: #ffffff;
}

/* ==========================================================================
4. Main Content & Toolbar Strip
========================================================================== */

.main-content {
flex: 1 1 auto;
min-width: 0;
padding: 1.35rem 1.5rem 2.25rem;
}

.toolbar-strip {
background: var(--bg-surface);
border: 1px solid var(--border-light);
border-radius: var(--radius-lg);
padding: 1rem 1.25rem;
margin-bottom: 1.25rem;
box-shadow: var(--shadow-xs);
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 1rem;
}

.toolbar-title-group {
min-width: 0;
}

.view-heading {
margin: 0;
font-size: 1.2rem;
font-weight: 700;
color: var(--text-primary);
line-height: 1.3;
}

.view-subtext {
margin: 0.25rem 0 0;
font-size: 0.85rem;
color: var(--text-muted);
}

.status-filter-pills {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.45rem;
}

.filter-pill {
border: 1px solid var(--border-medium);
background: var(--bg-surface);
color: var(--text-secondary);
font-size: 0.8125rem;
font-weight: 600;
padding: 0.36rem 0.8rem;
border-radius: var(--radius-pill);
display: inline-flex;
align-items: center;
gap: 0.4rem;
transition: all 0.15s ease;
}

.filter-pill:hover {
background: var(--bg-subtle);
border-color: #94a3b8;
color: var(--text-primary);
}

.filter-pill.is-active {
background: var(--navy-brand);
border-color: var(--navy-brand);
color: #ffffff;
}

.pill-dot {
width: 8px;
height: 8px;
border-radius: 50%;
display: inline-block;
}

.pill-dot.dot-online {
background: var(--status-online-dot);
}

.pill-dot.dot-degraded {
background: var(--status-degraded-dot);
}

.pill-dot.dot-offline {
background: var(--status-offline-dot);
}

.pill-icon {
color: var(--saffron-accent);
font-size: 0.85rem;
}

/* ==========================================================================
5. 3-Column Service Cards & Infinite Scroll Sentinel
========================================================================== */

.services-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 1.15rem;
}

.service-card {
background: var(--bg-surface);
border: 1px solid var(--border-light);
border-top: 4px solid var(--blue-primary);
border-radius: var(--radius-lg);
padding: 1.1rem 1.15rem 1rem;
box-shadow: var(--shadow-sm);
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 0.85rem;
transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.service-card:hover {
transform: translateY(-3px);
box-shadow: var(--shadow-md);
border-color: var(--border-medium);
}

.service-card.accent-saffron {
border-top-color: var(--saffron-accent);
}

.service-card.accent-emerald {
border-top-color: #059669;
}

.service-card.accent-indigo {
border-top-color: #4f46e5;
}

.service-card.accent-teal {
border-top-color: #0d9488;
}

.service-card.accent-rose {
border-top-color: #e11d48;
}

.service-card-top {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 0.65rem;
}

.service-card-head-left {
display: flex;
align-items: flex-start;
gap: 0.7rem;
min-width: 0;
}

.service-icon-square {
width: 38px;
height: 38px;
border-radius: var(--radius-md);
background: var(--blue-soft);
color: var(--blue-primary);
font-size: 0.9rem;
font-weight: 800;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}

.service-chips {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
min-width: 0;
}

.dept-chip,
.category-chip {
font-size: 0.71rem;
font-weight: 600;
padding: 0.14rem 0.5rem;
border-radius: var(--radius-sm);
line-height: 1.35;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.dept-chip {
background: #eff6ff;
color: #1e40af;
border: 1px solid #dbeafe;
}

.category-chip {
background: var(--bg-subtle);
color: var(--text-secondary);
border: 1px solid var(--border-light);
}

.bookmark-btn {
width: 32px;
height: 32px;
border-radius: 50%;
border: 1px solid var(--border-light);
background: var(--bg-subtle);
color: var(--text-muted);
font-size: 1rem;
line-height: 1;
display: inline-flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
transition: all 0.15s ease;
}

.bookmark-btn:hover {
background: var(--saffron-soft);
border-color: #fcd34d;
color: var(--saffron-accent);
}

.bookmark-btn.is-saved {
background: var(--saffron-soft);
border-color: var(--saffron-accent);
color: #b45309;
}

.service-card-body {
display: flex;
flex-direction: column;
gap: 0.42rem;
}

.service-title {
margin: 0;
font-size: 1rem;
font-weight: 700;
color: var(--text-primary);
line-height: 1.38;
}

.service-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.official-domain-row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 0.4rem;
margin-top: 0.25rem;
}

.official-domain-tag {
display: inline-flex;
align-items: center;
gap: 0.3rem;
font-family: var(--font-mono);
font-size: 0.74rem;
font-weight: 600;
color: #0f2942;
background: #f1f5f9;
border: 1px solid var(--border-light);
padding: 0.18rem 0.55rem;
border-radius: var(--radius-sm);
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.service-card-footer {
padding-top: 0.75rem;
border-top: 1px solid var(--border-light);
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.6rem;
}

.status-meta-group {
display: flex;
flex-direction: column;
gap: 0.2rem;
min-width: 0;
}

.status-badge {
display: inline-flex;
align-items: center;
gap: 0.38rem;
width: fit-content;
font-size: 0.74rem;
font-weight: 700;
padding: 0.18rem 0.58rem;
border-radius: var(--radius-pill);
line-height: 1.25;
}

.status-badge::before {
content: '';
width: 7px;
height: 7px;
border-radius: 50%;
flex-shrink: 0;
}

.status-badge.status-online {
background: var(--status-online-bg);
color: var(--status-online-text);
}

.status-badge.status-online::before {
background: var(--status-online-dot);
}

.status-badge.status-degraded {
background: var(--status-degraded-bg);
color: var(--status-degraded-text);
}

.status-badge.status-degraded::before {
background: var(--status-degraded-dot);
}

.status-badge.status-offline {
background: var(--status-offline-bg);
color: var(--status-offline-text);
}

.status-badge.status-offline::before {
background: var(--status-offline-dot);
}

.status-badge.status-unknown {
background: var(--status-unknown-bg);
color: var(--status-unknown-text);
}

.status-badge.status-unknown::before {
background: var(--status-unknown-dot);
}

.latency-meta {
font-size: 0.72rem;
color: var(--text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.visit-portal-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.32rem;
padding: 0.45rem 0.85rem;
border-radius: var(--radius-md);
background: var(--blue-primary);
color: #ffffff;
font-size: 0.8125rem;
font-weight: 600;
text-decoration: none;
white-space: nowrap;
flex-shrink: 0;
box-shadow: var(--shadow-xs);
transition: background-color 0.15s ease, transform 0.15s ease;
}

.visit-portal-btn:hover {
background: var(--blue-primary-hover);
color: #ffffff;
text-decoration: none;
transform: translateY(-1px);
}

.empty-state-box {
grid-column: 1 / -1;
background: var(--bg-surface);
border: 1px dashed var(--border-medium);
border-radius: var(--radius-lg);
padding: 2.5rem 1.5rem;
text-align: center;
color: var(--text-secondary);
}

.empty-state-box h3 {
margin: 0 0 0.4rem;
font-size: 1.05rem;
color: var(--text-primary);
}

.empty-state-box p {
margin: 0;
font-size: 0.875rem;
color: var(--text-muted);
}

.scroll-sentinel {
margin-top: 1.5rem;
padding: 0.85rem 1rem;
text-align: center;
color: var(--text-muted);
font-size: 0.825rem;
font-weight: 500;
}

/* ==========================================================================
6. Tools View (Domain Verifier & Saved Bookmarks)
========================================================================== */

.tools-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 1.25rem;
}

.tool-card {
background: var(--bg-surface);
border: 1px solid var(--border-light);
border-top: 4px solid var(--navy-brand);
border-radius: var(--radius-lg);
padding: 1.35rem;
box-shadow: var(--shadow-sm);
display: flex;
flex-direction: column;
gap: 1rem;
}

.tool-card-badge {
display: inline-block;
width: fit-content;
font-size: 0.72rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.04em;
background: var(--blue-soft);
color: var(--blue-primary);
padding: 0.18rem 0.6rem;
border-radius: var(--radius-pill);
margin-bottom: 0.45rem;
}

.tool-card-title {
margin: 0 0 0.35rem;
font-size: 1.1rem;
font-weight: 700;
color: var(--text-primary);
}

.tool-card-desc {
margin: 0;
font-size: 0.86rem;
color: var(--text-secondary);
}

.verifier-input-row {
display: flex;
gap: 0.6rem;
}

.verifier-url-input {
flex: 1 1 auto;
min-width: 0;
height: 42px;
padding: 0 0.9rem;
border-radius: var(--radius-md);
border: 1.5px solid var(--border-medium);
background: var(--bg-subtle);
font-family: var(--font-mono);
font-size: 0.85rem;
}

.verifier-url-input:focus {
outline: none;
background: var(--bg-surface);
border-color: var(--blue-primary);
box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.verifier-submit-btn {
height: 42px;
padding: 0 1.15rem;
border: none;
border-radius: var(--radius-md);
background: var(--blue-primary);
color: #ffffff;
font-weight: 600;
font-size: 0.875rem;
white-space: nowrap;
transition: background-color 0.15s ease;
}

.verifier-submit-btn:hover {
background: var(--blue-primary-hover);
}

.verify-url-result {
border-radius: var(--radius-md);
font-size: 0.875rem;
}

.verify-url-result:empty {
display: none;
}

.verify-banner {
padding: 0.95rem 1rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-light);
line-height: 1.45;
}

.verify-banner.is-verified {
background: #f0fdf4;
border-color: #86efac;
color: #14532d;
}

.verify-banner.is-warning {
background: #fffbeb;
border-color: #fcd34d;
color: #78350f;
}

.verify-banner.is-danger {
background: #fef2f2;
border-color: #fca5a5;
color: #7f1d1d;
}

.saved-services-list {
display: flex;
flex-direction: column;
gap: 0.65rem;
}

.saved-service-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.75rem;
padding: 0.75rem 0.9rem;
border-radius: var(--radius-md);
background: var(--bg-subtle);
border: 1px solid var(--border-light);
}

.saved-service-info {
min-width: 0;
}

.saved-service-title {
font-size: 0.88rem;
font-weight: 700;
color: var(--text-primary);
margin: 0 0 0.2rem;
}

.saved-service-actions {
display: flex;
align-items: center;
gap: 0.45rem;
flex-shrink: 0;
}

/* ==========================================================================
7. Admin Portal Styles (pages/admin.html)
========================================================================== */

.admin-container {
width: 100%;
max-width: 1440px;
margin: 0 auto;
padding: 1.5rem;
flex: 1 0 auto;
}

.login-wrapper {
min-height: calc(100vh - 150px);
display: flex;
align-items: center;
justify-content: center;
padding: 1.5rem;
}

.login-card {
width: 100%;
max-width: 430px;
background: var(--bg-surface);
border: 1px solid var(--border-light);
border-top: 4px solid var(--navy-brand);
border-radius: var(--radius-lg);
padding: 2rem 1.75rem;
box-shadow: var(--shadow-md);
}

.login-card h1 {
margin: 0 0 0.35rem;
font-size: 1.35rem;
color: var(--text-primary);
}

.login-card p {
margin: 0 0 1.4rem;
font-size: 0.875rem;
color: var(--text-muted);
}

.kpi-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 1rem;
margin-bottom: 1.35rem;
}

.kpi-card {
background: var(--bg-surface);
border: 1px solid var(--border-light);
border-left: 4px solid var(--blue-primary);
border-radius: var(--radius-md);
padding: 1rem 1.15rem;
box-shadow: var(--shadow-xs);
}

.kpi-card.kpi-online {
border-left-color: var(--status-online-dot);
}

.kpi-card.kpi-degraded {
border-left-color: var(--status-degraded-dot);
}

.kpi-card.kpi-offline {
border-left-color: var(--status-offline-dot);
}

.kpi-label {
font-size: 0.78rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--text-muted);
}

.kpi-value {
margin-top: 0.3rem;
font-size: 1.65rem;
font-weight: 800;
color: var(--text-primary);
line-height: 1.2;
}

.kpi-sub {
margin-top: 0.25rem;
font-size: 0.78rem;
color: var(--text-secondary);
}

.admin-tabs {
display: flex;
flex-wrap: wrap;
gap: 0.45rem;
border-bottom: 1px solid var(--border-light);
padding-bottom: 0.75rem;
margin-bottom: 1.25rem;
}

.admin-tab-btn {
border: 1px solid var(--border-medium);
background: var(--bg-surface);
color: var(--text-secondary);
font-size: 0.85rem;
font-weight: 600;
padding: 0.48rem 1rem;
border-radius: var(--radius-md);
transition: all 0.15s ease;
}

.admin-tab-btn:hover {
background: var(--bg-subtle);
color: var(--text-primary);
}

.admin-tab-btn.is-active {
background: var(--navy-brand);
border-color: var(--navy-brand);
color: #ffffff;
}

.admin-panel-card {
background: var(--bg-surface);
border: 1px solid var(--border-light);
border-radius: var(--radius-lg);
padding: 1.25rem;
box-shadow: var(--shadow-xs);
margin-bottom: 1.25rem;
}

.table-responsive {
width: 100%;
overflow-x: auto;
}

.data-table {
width: 100%;
border-collapse: collapse;
font-size: 0.84rem;
}

.data-table th {
background: var(--bg-subtle);
color: var(--text-secondary);
font-weight: 700;
text-align: left;
padding: 0.72rem 0.85rem;
border-bottom: 2px solid var(--border-light);
white-space: nowrap;
}

.data-table td {
padding: 0.72rem 0.85rem;
border-bottom: 1px solid var(--border-light);
color: var(--text-primary);
vertical-align: middle;
}

.data-table tbody tr:hover {
background: #f8fafc;
}

.form-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0.95rem;
}

.form-field {
display: flex;
flex-direction: column;
gap: 0.35rem;
}

.form-field.full-span {
grid-column: 1 / -1;
}

.form-field label {
font-size: 0.8125rem;
font-weight: 600;
color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
padding: 0.55rem 0.75rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-medium);
background: var(--bg-surface);
font-size: 0.875rem;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
outline: none;
border-color: var(--blue-primary);
box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.btn-primary,
.btn-secondary,
.btn-danger,
.btn-sm {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
border-radius: var(--radius-md);
font-weight: 600;
font-size: 0.85rem;
padding: 0.52rem 1rem;
border: 1px solid transparent;
transition: all 0.15s ease;
}

.btn-primary {
background: var(--blue-primary);
color: #ffffff;
}

.btn-primary:hover {
background: var(--blue-primary-hover);
}

.btn-secondary {
background: var(--bg-surface);
border-color: var(--border-medium);
color: var(--text-primary);
}

.btn-secondary:hover {
background: var(--bg-subtle);
}

.btn-danger {
background: #fee2e2;
border-color: #fca5a5;
color: #b91c1c;
}

.btn-danger:hover {
background: #fecaca;
}

.btn-sm {
padding: 0.32rem 0.65rem;
font-size: 0.78rem;
}

/* Modal */
.modal-backdrop {
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.52);
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
z-index: 80;
}

.modal-dialog {
width: 100%;
max-width: 680px;
max-height: 90vh;
overflow-y: auto;
background: var(--bg-surface);
border-radius: var(--radius-lg);
border: 1px solid var(--border-light);
box-shadow: var(--shadow-lg);
padding: 1.5rem;
}

.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 0.85rem;
margin-bottom: 1.1rem;
border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
margin: 0;
font-size: 1.15rem;
}

.modal-footer {
display: flex;
justify-content: flex-end;
gap: 0.65rem;
margin-top: 1.25rem;
padding-top: 0.9rem;
border-top: 1px solid var(--border-light);
}

/* Toast Notification */
.toast-msg {
position: fixed;
bottom: 1.35rem;
right: 1.35rem;
z-index: 100;
max-width: 380px;
padding: 0.8rem 1.1rem;
border-radius: var(--radius-md);
background: var(--navy-brand);
color: #ffffff;
font-size: 0.85rem;
font-weight: 600;
box-shadow: var(--shadow-lg);
border-left: 4px solid var(--saffron-accent);
}

.toast-msg.is-success {
border-left-color: var(--status-online-dot);
}

.toast-msg.is-error {
background: #7f1d1d;
border-left-color: #f87171;
}

/* ==========================================================================
8. Footer
========================================================================== */

.site-footer {
background: var(--bg-surface);
border-top: 1px solid var(--border-light);
padding: 1rem 1.5rem;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 0.85rem;
font-size: 0.83rem;
color: var(--text-secondary);
}

.footer-left {
font-weight: 600;
color: var(--text-primary);
}

.footer-links {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 1.15rem;
}

.footer-links a {
color: var(--text-secondary);
font-weight: 500;
}

.footer-links a:hover {
color: var(--blue-primary);
}

/* ==========================================================================
9. Responsive Breakpoints
========================================================================== */

@media (max-width: 1120px) {
.services-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}

@media (max-width: 820px) {
.top-brand-strip {
flex-wrap: wrap;
padding: 0.4rem 0.9rem;
}

.app-header {
flex-wrap: wrap;
padding: 0.6rem 0.9rem;
gap: 0.65rem;
}

.header-left {
order: 1;
}

.header-right {
order: 2;
margin-left: auto;
}

.header-search-wrap {
order: 3;
flex: 1 1 100%;
max-width: 100%;
}

/* Slide-over mobile drawer for department rail */
.sidebar-backdrop {
display: block;
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.45);
z-index: 45;
}

.dept-sidebar {
position: fixed;
top: 0;
left: 0;
bottom: 0;
height: 100vh;
width: 285px;
max-width: 82vw;
z-index: 50;
transform: translateX(-105%);
box-shadow: var(--shadow-lg);
border-right: 1px solid var(--border-light);
}

.dept-sidebar.is-collapsed {
width: 285px;
transform: translateX(-105%);
}

.dept-sidebar.is-mobile-open {
transform: translateX(0);
}

.main-content {
padding: 1rem 0.95rem 1.75rem;
}

.tools-grid,
.form-grid {
grid-template-columns: 1fr;
}
}

@media (max-width: 600px) {
.services-grid,
.kpi-grid {
grid-template-columns: 1fr;
}

.verifier-input-row {
flex-direction: column;
}

.site-footer {
flex-direction: column;
align-items: flex-start;
padding: 0.95rem;
}
}