:root {
  --primary:       #1a6b3a;
  --primary-dark:  #134f2b;
  --primary-light: #e8f5ee;
  --accent:        #f0a500;
  --accent-dark:   #c88600;
  --sidebar-w:     255px;
  --topbar-h:      64px;
  --danger:        #dc3545;
  --success:       #198754;
  --warning:       #ffc107;
  --radius:        14px;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:     0 4px 18px rgba(0,0,0,0.10);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.16);
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f0f2f5; margin: 0; color: #1e2b22; }

/* ─────────────── LOGIN / GATE SCREENS ─────────────── */
.login-screen {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 70% 20%, rgba(240,165,0,0.18) 0%, transparent 55%),
    linear-gradient(150deg, var(--primary-dark) 0%, #1e7a42 55%, #2d9e5a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  position: relative; overflow: hidden;
}
/* Decorative honeycomb circles */
.login-screen::before,
.login-screen::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
  background: #fff;
  pointer-events: none;
}
.login-screen::before { width: 420px; height: 420px; top: -120px; right: -100px; }
.login-screen::after  { width: 280px; height: 280px; bottom: -80px; left: -60px; }

.login-card {
  background: #fff;
  border-radius: 22px;
  padding: 3rem 2.5rem 2.25rem;
  width: 100%; max-width: 450px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.30), 0 2px 0 rgba(240,165,0,0.6) inset;
  position: relative; z-index: 1;
  border-top: 5px solid var(--accent);
  animation: cardIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo { text-align: center; margin-bottom: 1.5rem; }

.login-icon-circle {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 0.9rem;
  box-shadow: 0 8px 24px rgba(26,107,58,0.40);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 8px 24px rgba(26,107,58,0.40); }
  50%      { box-shadow: 0 8px 32px rgba(26,107,58,0.60), 0 0 0 8px rgba(26,107,58,0.08); }
}
.login-icon-circle i { font-size: 2.2rem; color: #fff; }

.login-brand {
  font-size: 2.1rem; font-weight: 900; color: var(--primary);
  letter-spacing: 0.06em; line-height: 1;
}
.login-system-name {
  font-size: 0.78rem; font-weight: 700; color: var(--accent);
  letter-spacing: 0.12em; margin-top: 0.2rem; text-transform: uppercase;
}
.login-org-name {
  font-size: 0.76rem; color: #8c9b94; margin-top: 0.5rem; line-height: 1.45;
  max-width: 280px; margin-left: auto; margin-right: auto;
}

.login-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1.4rem 0 1.6rem;
  color: #c8d6cc; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: #e9ecef;
}

/* Microsoft gate info block */
.gate-ms-block {
  background: linear-gradient(135deg, #f0f8ff, #e8f4fd);
  border-radius: 12px; padding: 1rem 1.1rem;
  border: 1px solid #cce4f8; text-align: left;
  display: flex; gap: 0.85rem; align-items: flex-start;
}
.gate-ms-block .gate-ms-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: #0078d4; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.gate-ms-block .gate-ms-icon i { font-size: 1.1rem; color: #fff; }
.gate-ms-block .gate-ms-title { font-size: 0.88rem; font-weight: 700; color: #1a1a2e; margin-bottom: 0.2rem; }
.gate-ms-block .gate-ms-desc  { font-size: 0.78rem; color: #5a6570; margin: 0; line-height: 1.4; }

/* Buttons */
.btn-login {
  background: linear-gradient(135deg, var(--primary) 0%, #2d9e5a 100%);
  border: none; color: #fff; font-weight: 700; letter-spacing: 0.03em;
  border-radius: 12px; padding: 0.8rem;
  box-shadow: 0 4px 16px rgba(26,107,58,0.35);
  transition: box-shadow 0.2s, transform 0.15s;
}
.btn-login:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff; box-shadow: 0 6px 22px rgba(26,107,58,0.48); transform: translateY(-1px);
}
.btn-ms {
  background: #0078d4; border-color: #0078d4; color: #fff;
  font-weight: 700; letter-spacing: 0.02em;
  border-radius: 12px; padding: 0.8rem;
  box-shadow: 0 4px 14px rgba(0,120,212,0.30);
  transition: box-shadow 0.2s, transform 0.15s;
}
.btn-ms:hover {
  background: #106ebe; border-color: #106ebe; color: #fff;
  box-shadow: 0 6px 20px rgba(0,120,212,0.42); transform: translateY(-1px);
}

.login-add-user {
  text-decoration: none; font-size: 0.85rem; color: #8c9b94;
  transition: color 0.15s;
}
.login-add-user:hover { color: var(--primary); }
.login-footer-note {
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #f0f3f1;
  text-align: center; font-size: 0.72rem; color: #b0bdb5;
}

/* ─────────────── APP LAYOUT ─────────────── */
.logo-circle-sm {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.25);
}
.logo-circle-sm i { font-size: 1.1rem; color: #fff; }

#sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: linear-gradient(175deg, var(--primary-dark) 0%, #1c7540 60%, #1a6b3a 100%);
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
  box-shadow: 3px 0 20px rgba(0,0,0,0.15);
}
#mainContent {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
#topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e8edf2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}
.page-area { padding: 1.75rem; flex: 1; }

/* ─────────────── SIDEBAR ─────────────── */
.sidebar-brand {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 1.35rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.10);
}
.sidebar-nav { list-style: none; padding: 0.6rem 0; margin: 0; flex: 1; }

.sidebar-nav > li > a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 1.3rem;
  color: rgba(255,255,255,0.78);
  text-decoration: none; font-size: 0.9rem;
  transition: all 0.18s;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  margin-right: 0.5rem;
}
.sidebar-nav > li > a:hover,
.sidebar-nav > li > a.active {
  background: rgba(255,255,255,0.13);
  color: #fff;
  border-left-color: var(--accent);
}
.sidebar-nav li a i { font-size: 1rem; width: 20px; flex-shrink: 0; }

.sidebar-section-label {
  padding: 0.7rem 1.3rem 0.25rem;
  font-size: 0.67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.38);
  list-style: none;
}
.sidebar-divider {
  border-top: 1px solid rgba(255,255,255,0.10);
  margin: 0.3rem 0.8rem;
  list-style: none;
}

/* Collapsible groups */
.sidebar-group { list-style: none; }
.sidebar-group-hd {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  color: rgba(255,255,255,0.58);
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  user-select: none;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-group-hd:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.sidebar-group-hd i:first-child { font-size: 1rem; width: 20px; flex-shrink: 0; }
.sg-chevron { font-size: 0.7rem; transition: transform 0.25s ease; flex-shrink: 0; margin-left: auto; }
.sidebar-group.collapsed .sg-chevron { transform: rotate(-90deg); }

.sidebar-subnav { list-style: none; padding: 0; margin: 0; overflow: hidden; max-height: 500px; transition: max-height 0.3s ease; }
.sidebar-group.collapsed .sidebar-subnav { max-height: 0; }
.sidebar-subnav li a {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 1.3rem 0.55rem 2.85rem;
  color: rgba(255,255,255,0.68);
  text-decoration: none; font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  margin-right: 0.5rem;
}
.sidebar-subnav li a:hover,
.sidebar-subnav li a.active {
  background: rgba(255,255,255,0.11);
  color: #fff; border-left-color: var(--accent);
}
.sidebar-subnav li a i { font-size: 0.9rem; width: 18px; flex-shrink: 0; }

/* M365 pill */
.m365-pill {
  margin: 0 0.9rem 0.5rem;
  background: rgba(255,255,255,0.09);
  border-radius: 20px; border: 1px solid rgba(255,255,255,0.12);
  padding: 0.32rem 0.85rem;
  display: flex; align-items: center; gap: 0.45rem;
  font-size: 0.74rem; color: rgba(255,255,255,0.8);
}
.m365-dot { width: 8px; height: 8px; border-radius: 50%; background: #6c757d; flex-shrink: 0; }
.m365-dot.connected { background: #40d463; box-shadow: 0 0 6px #40d463; }

/* Sidebar footer */
.sidebar-footer {
  padding: 1rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.12);
}
.avatar-sm {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.82rem; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  border: 2px solid rgba(255,255,255,0.3);
}
.x-small { font-size: 0.72rem; }

/* ─────────────── TOPBAR ─────────────── */
.topbar-m365 {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--primary-light); color: var(--primary);
  border-radius: 20px; padding: 0.3rem 0.85rem;
  font-size: 0.78rem; font-weight: 700; cursor: pointer;
  border: 1px solid #c5dece;
  transition: background 0.15s;
}
.topbar-m365:hover { background: #d0e9d8; }

/* ─────────────── STAT CARDS ─────────────── */
.stat-card {
  background: #fff; border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--primary);
  display: flex; align-items: center; gap: 1.1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.danger  { border-left-color: var(--danger); }
.stat-icon {
  width: 54px; height: 54px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.warning { background: #fff8e1; color: #c87f00; }
.stat-icon.success { background: #e8f5e9; color: var(--success); }
.stat-icon.danger  { background: #fdecea; color: var(--danger); }
.stat-number { font-size: 2.1rem; font-weight: 800; line-height: 1; color: #1a2520; }
.stat-label  { font-size: 0.81rem; color: #7a8c82; margin-top: 3px; }

/* ─────────────── CARDS ─────────────── */
.card { border: none; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header {
  background: #fff; border-bottom: 1px solid #eef1ee;
  font-weight: 700; border-radius: var(--radius) var(--radius) 0 0 !important;
  padding: 1rem 1.25rem;
}

/* ─────────────── TABLE ─────────────── */
.table-clean { font-size: 0.875rem; }
.table-clean thead th {
  background: #f7f9f7; font-weight: 700; color: #3d5045;
  border-bottom: 2px solid #e3e9e5; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.table-clean tbody tr { transition: background 0.12s; }
.table-clean tbody tr:hover { background: #f5faf6; }

/* ─────────────── BADGES ─────────────── */
.badge-status {
  padding: 0.35em 0.85em; border-radius: 20px;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em;
}
.badge-pending           { background: #fff3cd; color: #7a5c00; }
.badge-approved          { background: #d1e7dd; color: #0a3622; }
.badge-rejected          { background: #f8d7da; color: #58151c; }
.badge-draft             { background: #e8eaec; color: #41464b; }
.badge-info-requested    { background: #fff0c2; color: #7a5800; border: 1px solid #f0a500; }
.badge-awaiting-decision { background: #cff4fc; color: #055160; border: 1px solid #0dcaf0; }
.badge-paid              { background: #0a3622; color: #fff; font-weight: 700; }
.badge-processing        { background: #cfe2ff; color: #084298; }

/* ─────────────── CONCEPT CARDS ─────────────── */
.req-card {
  background: #fff; border-radius: 12px;
  border: 1px solid #e8edea;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  cursor: pointer;
}
.req-card:hover {
  box-shadow: 0 6px 20px rgba(26,107,58,0.10);
  transform: translateY(-2px);
  border-color: #c8dece;
}
.req-card-title { font-weight: 700; font-size: 0.95rem; color: #1e2b22; }
.req-card-meta  { font-size: 0.8rem; color: #7a8c82; }

/* ─────────────── DETAIL VIEW ─────────────── */
.detail-section {
  background: #fff; border-radius: var(--radius);
  padding: 1.5rem 1.75rem; margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.detail-label {
  font-size: 0.73rem; font-weight: 700; color: #8a9e90;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.detail-value { font-size: 0.95rem; color: #1e2b22; margin-top: 3px; }

/* ─────────────── TIMELINE ─────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 0; bottom: 0;
  width: 2px; background: #dee2e6;
}
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-dot {
  position: absolute; left: -22px; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 2px currentColor;
}
.timeline-dot.approved  { color: var(--success); background: var(--success); }
.timeline-dot.rejected  { color: var(--danger);  background: var(--danger); }
.timeline-dot.comment   { color: #0d6efd; background: #0d6efd; }
.timeline-dot.submitted { color: var(--primary); background: var(--primary); }
.timeline-text { font-size: 0.88rem; }
.timeline-time { font-size: 0.75rem; color: #adb5bd; }

/* ─────────────── FORMS ─────────────── */
.form-section {
  background: #fff; border-radius: var(--radius);
  padding: 1.5rem 1.75rem; margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.form-section h6 {
  color: var(--primary); font-weight: 800; margin-bottom: 1rem;
  border-bottom: 2px solid var(--primary-light); padding-bottom: 0.6rem;
  font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.form-control, .form-select {
  border-radius: 8px; border: 1.5px solid #dde4e0;
  font-size: 0.9rem; transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,107,58,0.12);
}

/* ─────────────── BUTTONS ─────────────── */
.btn-primary { background: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ─────────────── EMPTY STATE ─────────────── */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: #b0c0b5; }
.empty-state i { font-size: 3.8rem; display: block; margin-bottom: 1rem; opacity: 0.6; }
.empty-state h6 { font-weight: 700; color: #7a8c82; }
.empty-state p  { font-size: 0.88rem; }

/* ─────────────── SEARCH BAR ─────────────── */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 2.6rem; border-radius: 10px; }
.search-wrap i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: #b0c0b5; }

/* ─────────────── SETTINGS PAGE ─────────────── */
.settings-banner {
  border-radius: var(--radius); padding: 1.35rem 1.6rem;
}
.settings-banner-connected {
  background: linear-gradient(135deg, var(--primary), #2d9e5a);
  color: #fff;
}
.settings-banner-disconnected {
  background: linear-gradient(135deg, #495057, #6c757d);
  color: #fff;
}

/* ─────────────── M365 SPINNER OVERLAY ─────────────── */
.m365-spinner {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.m365-spinner-box {
  background: #fff; border-radius: 18px;
  padding: 2.5rem 3rem; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,0.30);
}

/* ─────────────── USER ROW ─────────────── */
.user-row:last-child { border-bottom: none !important; }

/* ─────────────── DEPLOY CARDS ─────────────── */
.deploy-card { border: 1px solid #dee2e6; border-radius: var(--radius); overflow: hidden; height: 100%; }
.deploy-card-recommended { border-color: var(--success); }
.deploy-card-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8f9fa; border-bottom: 1px solid #dee2e6;
  font-size: 0.95rem;
}
.deploy-card-header i { font-size: 1.5rem; color: var(--primary); }
.deploy-card-recommended .deploy-card-header { background: #e8f5e9; border-color: #c8e6c9; }
.deploy-card-recommended .deploy-card-header i { color: var(--success); }
.deploy-card-body { padding: 1.25rem; }
.deploy-step { display: flex; gap: 0.75rem; margin-bottom: 0.85rem; align-items: flex-start; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary);
  color: #fff; font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px;
}
.deploy-card-recommended .step-num { background: var(--success); }
.deploy-step > div { font-size: 0.85rem; line-height: 1.5; }

/* ─────────────── ACCESS FLOW ─────────────── */
.access-flow { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; padding: 1rem 0; }
.flow-step {
  text-align: center; background: #f8f9fa; border: 1px solid #dee2e6;
  border-radius: 10px; padding: 0.65rem 1rem; min-width: 100px;
}
.flow-step i { font-size: 1.4rem; color: #6c757d; display: block; margin-bottom: 3px; }
.flow-step-ms  { background: #e8f0fe; border-color: #c5d8f5; }
.flow-step-ms  i { color: #0078d4; }
.flow-step-ok  { background: #e8f5e9; border-color: #c8e6c9; }
.flow-step-ok  i { color: var(--success); }
.flow-step-app { background: var(--primary-light); border-color: #b8d8c4; }
.flow-step-app i { color: var(--primary); }
.flow-label { font-size: 0.75rem; font-weight: 600; color: #495057; }
.flow-label small { display: block; font-weight: 400; color: #6c757d; }
.flow-arrow { color: #adb5bd; font-size: 1.1rem; }

/* ─────────────── FINANCE ─────────────── */
.bg-purple  { background-color: #6f42c1 !important; color: #fff; }
.btn-finance { background: #0d47a1; border-color: #0d47a1; color: #fff; font-weight: 700; }
.btn-finance:hover { background: #083591; border-color: #083591; color: #fff; }
.text-finance { color: #0d47a1 !important; }
.bg-finance   { background-color: #0d47a1 !important; color: #fff; }
.frq-budget-bar { height: 8px; border-radius: 4px; background: #e9ecef; overflow: hidden; }
.frq-budget-bar .used { height: 100%; border-radius: 4px; transition: width 0.4s; }
.rf-balance-tracker { margin: 6px 0 4px; }
.rf-balance-tracker .progress { background: #e9ecef; }
.rf-balance-tracker .progress-bar { transition: width 0.4s ease; }

/* ─────────────── SIGNATURE PAD ─────────────── */
#sigCanvas { user-select: none; -webkit-user-select: none; }
#sigCanvas:active { cursor: crosshair; }
.sig-display {
  display: inline-block; max-height: 44px; max-width: 140px;
  object-fit: contain; vertical-align: middle;
  border: 1px solid #dee2e6; border-radius: 4px;
  background: #fdfdfd; padding: 2px;
}
.sig-ts { font-size: 0.72rem; color: #495057; display: block; margin-top: 2px; }
.sig-placeholder { color: #adb5bd; font-size: 0.78rem; font-style: italic; }

/* ─────────────── PRINT ─────────────── */
@media print {
  #sidebar, #topbar, .no-print { display: none !important; }
  #mainContent { margin-left: 0; }
}

/* ─────────────── SCROLLBAR ─────────────── */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #d0d8d3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aabab0; }

/* ─────────────── PROFILE DROPDOWN ─────────────── */
.topbar-avatar-btn {
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  border: 2.5px solid transparent;
}
.topbar-avatar-btn:hover {
  box-shadow: 0 0 0 3px rgba(26,107,58,0.2);
  transform: scale(1.06);
}
.profile-dropdown {
  min-width: 270px;
  border-radius: 14px;
  border: 1px solid #e5ebe7;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.14) !important;
  margin-top: 8px !important;
}
.profile-dd-header {
  display: flex;
  align-items: center;
  padding: 1.1rem 1.2rem 0.9rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  gap: 0.75rem;
}
.avatar-lg {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem; flex-shrink: 0;
  border: 2.5px solid rgba(255,255,255,0.4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.profile-dd-header .fw-bold { color: #fff; font-size: 0.95rem; }
.profile-dd-info {
  padding: 0.75rem 1.2rem 0.6rem;
  background: #f8faf8;
  border-bottom: 1px solid #eef1ee;
}
.profile-dd-row {
  font-size: 0.8rem;
  color: #5a6e60;
  padding: 0.18rem 0;
  display: flex;
  align-items: center;
}
.profile-dd-item {
  font-size: 0.875rem;
  padding: 0.55rem 1.2rem;
  display: flex;
  align-items: center;
  color: #3d5045;
  transition: background 0.15s;
}
.profile-dd-item:hover { background: #f0f7f2; color: var(--primary); }
.profile-dd-item.text-danger { color: #dc3545 !important; }
.profile-dd-item.text-danger:hover { background: #fff5f5; }

/* Topbar hamburger (mobile only) */
.topbar-hamburger {
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
  text-decoration: none;
}

/* ─────────────── MOBILE SIDEBAR BACKDROP ─────────────── */
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
  backdrop-filter: blur(2px);
  animation: pageFadeIn 0.25s ease both;
}

/* ─────────────── TRANSITIONS & ANIMATIONS ─────────────── */

/* App fades in after login */
@keyframes appFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-fade-in {
  animation: appFadeIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* App fades out on logout */
@keyframes appFadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}
.app-fade-out {
  animation: appFadeOut 0.28s ease both;
  pointer-events: none;
}

/* Page content fades in on every navigation */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-fade-in {
  animation: pageFadeIn 0.3s ease both;
}

/* Login card already has cardIn animation — add smooth exit too */
.login-screen { transition: opacity 0.3s ease; }

/* Sidebar nav items — smooth active indicator */
.sidebar-nav > li > a,
.sidebar-subnav li a {
  transition: background 0.18s, border-left-color 0.18s, color 0.18s, transform 0.15s;
}
.sidebar-nav > li > a:active,
.sidebar-subnav li a:active { transform: translateX(2px); }

/* Topbar smooth title change */
#pageTitle { transition: opacity 0.2s ease; }

/* Stat cards stagger on dashboard load */
.stat-card { animation: pageFadeIn 0.35s ease both; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.20s; }

/* Req cards stagger in list views */
.req-card { animation: pageFadeIn 0.3s ease both; }

/* Modal open feels snappier */
.modal.fade .modal-dialog { transition: transform 0.2s ease, opacity 0.2s ease; }

/* Button press feedback */
.btn { transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.97); }

/* ─────────────── MOBILE RESPONSIVE ─────────────── */
@media (max-width: 991.98px) {

  /* Sidebar slides in from the left as an overlay */
  #sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 200;
    box-shadow: none;
  }
  #sidebar.sidebar-mobile-open {
    transform: translateX(0);
    box-shadow: 6px 0 30px rgba(0,0,0,0.25);
  }

  /* Main content takes full width */
  #mainContent { margin-left: 0; }

  /* Show hamburger button */
  .topbar-hamburger { display: inline-flex !important; }

  /* Topbar adjustments */
  #topbar { padding: 0 1rem; }
  #pageTitle { font-size: 1rem; }

  /* Page area padding */
  .page-area { padding: 1rem; }

  /* Login card full width on small screens */
  .login-card {
    padding: 2rem 1.4rem 1.75rem;
    border-radius: 18px;
  }

  /* Stack stat cards */
  .row .col-md-3, .row .col-md-4, .row .col-md-6 { margin-bottom: 0.75rem; }

  /* Tables scroll horizontally */
  .table-responsive-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table { min-width: 600px; }

  /* Form sections full width */
  .form-section { padding: 1.1rem; }
  .detail-section { padding: 1.1rem; }

  /* Detail view button groups wrap */
  .detail-section .d-flex.gap-2 { flex-wrap: wrap; }

  /* Hide date in topbar — too cramped */
  #topbarDate { display: none !important; }

  /* M365 indicator — icon only on mobile */
  #topbarM365Label { display: none !important; }

  /* Modals full width */
  .modal-dialog { margin: 0.5rem; }
  .modal-dialog.modal-lg { max-width: 100%; }
}

@media (max-width: 575.98px) {
  /* Extra small — phones */
  .login-brand  { font-size: 1.7rem; }
  .stat-number  { font-size: 1.6rem; }
  .page-area    { padding: 0.75rem; }
  #topbar       { padding: 0 0.75rem; }
  .profile-dropdown { min-width: 240px; }

  /* Stack form rows */
  .row.g-3 > [class*='col-'] { margin-bottom: 0.5rem; }

  /* Concept cards */
  .req-card { padding: 0.85rem 1rem; }
}
