:root{
  --primary-color:#8b2e3e;
  --secondary-color:#3498db;
  --muted:#6b7280;
  --bg:#f8f9fa;
  --surface:#ffffff;
  --radius:8px;
  --max-content-width:1200px;
  --container-padding:1rem;
}

/* Reset and sensible defaults */
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;background:var(--bg);color:#111}

/* Responsive container */
.app-container{width:100%;max-width:var(--max-content-width);margin:0 auto;padding:0 var(--container-padding)}

/* Utility helpers */
.flex-center{display:flex;align-items:center;justify-content:center}
.stack{display:flex;flex-direction:column;gap:0.5rem}
.btn-primary{background:var(--primary-color);color:#fff;border:0;padding:0.5rem 0.75rem;border-radius:6px}
.btn-outline{background:transparent;border:1px solid rgba(0,0,0,0.08);padding:0.45rem 0.6rem;border-radius:6px}

/* Card header gradient and avatar helpers */
.card-top-gradient{height:130px;border-top-left-radius:var(--radius);border-top-right-radius:var(--radius);background:linear-gradient(135deg,#9f2036 0%,#1f2937 100%);}
.card-avatar-offset{margin-top:-58px}
.avatar-lg{width:116px;height:116px;border-radius:50%;object-fit:cover;border:4px solid #fff;box-shadow:0 8px 24px rgba(15,23,42,0.2);display:block}
.avatar-placeholder{width:116px;height:116px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e5e7eb;color:#1f2937;font-size:2.2rem;font-weight:800;border:4px solid #fff;box-shadow:0 8px 24px rgba(15,23,42,0.2);}

/* Responsive images and cards */
img{max-width:100%;height:auto;display:block}
.card{background:var(--surface);border-radius:var(--radius);box-shadow:0 1px 6px rgba(16,24,40,0.06);padding:1rem}
.widget-card{border:1px solid #d1d5db;border-radius:6px;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,0.12);transition:box-shadow 0.15s ease;}
.widget-card.maroon-border,.calendar-card-premium{border:2px solid #7f182b !important;box-shadow:0 14px 38px rgba(127,24,43,0.08) !important;background:#fff;}
.widget-card:hover{box-shadow:0 8px 16px rgba(0,0,0,0.15)}
.widget-body{padding:12px}
.widget-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;gap:10px}
.widget-title{font-size:0.82rem;font-weight:700;color:#1f2937;margin:0;line-height:1.2}
.widget-link{font-size:0.72rem;color:#2563eb;text-decoration:none;font-weight:500}
.widget-scroll{overflow-y:auto}
.widget-scroll-sm{max-height:220px}
.widget-scroll-md{max-height:220px}

/* Widget item layout for announcements and events */
.widget-item-card{display:block;padding:8px 0 10px;margin-bottom:8px;border-bottom:1px solid #e5e7eb}
.widget-item-card:last-child{margin-bottom:0;border-bottom:0}
.widget-item-title{display:block;font-size:0.88rem;font-weight:700;color:#111827;line-height:1.3;margin-bottom:4px;word-break:break-word;overflow-wrap:anywhere}
.widget-item-text{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;font-size:0.8rem;line-height:1.45;color:#6b7280;margin-bottom:6px;word-break:break-word;overflow-wrap:anywhere}
.widget-item-meta{display:flex;flex-direction:column;align-items:flex-start;gap:6px;font-size:0.78rem;color:#6b7280}
.widget-item-meta .meta-date{display:block;font-size:0.74rem;color:#6b7280}
.widget-item-meta .meta-status{display:inline-flex;align-items:center;justify-content:center;padding:3px 9px;border-radius:999px;background:rgba(159,32,54,0.08);color:#7f182b;font-weight:700;font-size:0.68rem;white-space:nowrap}

.badge-status-pending{display:inline-flex;align-items:center;justify-content:center;padding:0.4rem 0.7rem;border-radius:999px;background:#f59e0b;color:#fff;font-weight:700;line-height:1}
.badge-status-approved{display:inline-flex;align-items:center;justify-content:center;padding:0.4rem 0.7rem;border-radius:999px;background:#16a34a;color:#fff;font-weight:700;line-height:1}
.badge-status-available{display:inline-flex;align-items:center;justify-content:center;padding:0.4rem 0.7rem;border-radius:999px;background:#0ea5e9;color:#fff;font-weight:700;line-height:1}
.badge-status-unavailable{display:inline-flex;align-items:center;justify-content:center;padding:0.4rem 0.7rem;border-radius:999px;background:#9f2036;color:#fff;font-weight:700;line-height:1}
.badge-status-borrowed{display:inline-flex;align-items:center;justify-content:center;padding:0.4rem 0.7rem;border-radius:999px;background:#0891b2;color:#fff;font-weight:700;line-height:1}
.badge-status-returned{display:inline-flex;align-items:center;justify-content:center;padding:0.4rem 0.7rem;border-radius:999px;background:#16a34a;color:#fff;font-weight:700;line-height:1}

.requisition-side-header{display:flex;justify-content:space-between;align-items:center;gap:0.75rem;margin-bottom:0.75rem}
.request-status-badges{display:flex;flex-wrap:wrap;gap:0.5rem;margin-bottom:0.75rem}

.notification-list-item{display:block;color:inherit;text-decoration:none}
.notification-row{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid #e5e7eb}
.catalog-pagination-wrap{display:flex;justify-content:center;margin:10px 0 0;padding:10px 0 6px;}

.catalog-pagination-nav{display:flex;justify-content:center;width:100%;}

.catalog-pagination-list{margin:0;gap:6px;flex-wrap:wrap;justify-content:center}

/* Catalog pagination styling */
.catalog-pagination-wrap .pagination {
  margin: 0;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.catalog-pagination-wrap .page-item {
  margin: 0;
}

.catalog-pagination-wrap .page-link {
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px !important;
  border: 1px solid rgba(159, 32, 54, 0.18);
  color: #7f182b;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.04);
  padding: 0 12px;
}

.catalog-pagination-wrap .page-link:hover {
  color: #fff;
  background: #9f2036;
  border-color: #9f2036;
}

.catalog-pagination-wrap .page-item.active .page-link {
  background: linear-gradient(135deg, #9f2036 0%, #6f1325 100%);
  border-color: transparent;
  color: #fff;
}

.catalog-pagination-wrap .page-item.disabled .page-link {
  color: #a8a8a8;
  background: #f7f7f7;
  border-color: #ececec;
}

.catalog-pagination-wrap .page-link svg {
  width: 0.95rem;
  height: 0.95rem;
}
.notification-menu{
  width:min(92vw, 420px);
  min-width:360px;
  border-radius:18px;
  overflow:hidden;
}
.notification-menu-header{
  padding:12px 14px;
  gap:10px;
  flex-wrap:wrap;
}
.notification-menu-items{
  max-height:420px;
  overflow-y:auto;
}
.notification-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:14px 16px;
  border-bottom:1px solid rgba(159,32,54,.08);
  text-decoration:none;
  transition:background-color .2s ease;
}
.notification-item:hover{background:rgba(159,32,54,.04)}
.notification-item.unread{background:linear-gradient(135deg, rgba(159,32,54,.04), rgba(247,210,135,.06))}
.notification-icon{width:34px;height:34px;border-radius:12px;background:linear-gradient(135deg, rgba(159,32,54,.12), rgba(247,210,135,.12));display:flex;align-items:center;justify-content:center;color:#7f182b;flex-shrink:0}
.notification-row.unread{border-left:3px solid #9f2036;padding-left:7px}
.notification-dot{flex-shrink:0;width:32px;height:32px;border-radius:999px;background:#f3f4f6;display:flex;align-items:center;justify-content:center;color:#9f2036}
.notification-title{font-size:0.85rem;font-weight:600;color:#1f2937;line-height:1.3}
.notification-message{font-size:0.75rem;color:#6b7280;line-height:1.35;margin-top:4px}
.notification-time{font-size:0.7rem;color:#9ca3af;margin-top:4px}
.notification-status{font-size:0.7rem;font-weight:600;color:#6b7280;flex-shrink:0;align-self:flex-start;margin-top:2px}
.notification-menu-head{font-size:0.8rem;font-weight:700}
.notification-menu-empty{font-size:0.75rem}
.notification-count-small{font-size:0.7rem}
.notification-mobile-badge{top:-6px;right:-6px;display:none}
@media (max-width: 575.98px){
  .notification-menu{
    width:calc(100vw - 1rem);
    min-width:0;
    max-width:calc(100vw - 1rem);
  }
  .notification-menu-head,.notification-count-small,.notification-read-all-btn{font-size:0.72rem}
  .notification-item{padding:12px 14px}
  .notification-icon{width:32px;height:32px}
}
.nav-link-button{display:flex;align-items:center;gap:10px;width:100%;padding:10px 16px;text-align:left;border:none;background:none;color:inherit;cursor:pointer}
.nav-chevron-right{margin-left:auto;font-size:0.8rem}
.dropdown-round{min-width:180px;border-radius:8px}
.dropdown-user-menu{min-width:220px;border-radius:16px;padding:8px 0;margin-top:10px}
.dropdown-language-menu{min-width:180px;border-radius:12px}
.profile-icon-xs{font-size:0.7rem}
.text-preline{white-space:pre-line;line-height:1.6}
.message-content-narrow{max-width:72%}
.panel-min-height{min-height:420px}

.calendar-card{height:100%}
.calendar-card-premium{border:2px solid #7f182b !important;box-shadow:0 14px 38px rgba(127,24,43,0.08) !important}
.calendar-body{padding:12px}
.calendar-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.calendar-title{font-size:0.82rem;font-weight:700;color:#1f2937}
.calendar-nav{display:flex;gap:2px}
.calendar-nav button{background:none;border:none;font-size:1rem;cursor:pointer;padding:0 4px}
.calendar-month-wrap{margin-top:6px;margin-bottom:6px;text-align:center}
.calendar-month{font-size:0.88rem;font-weight:700}
.calendar-weekdays{font-size:0.68rem;margin:0 -3px}
.calendar-weekdays .col,
.calendar-grid .col{padding:3px}
.calendar-grid{margin:0 -4px}
.calendar-links{display:flex;justify-content:space-between;margin-top:6px;padding-top:6px;font-size:0.74rem;border-top:1px solid #eef2f7}

.message-thread{max-height:58vh;overflow-y:auto;padding:20px;background:#f8fafc}
.message-row{margin-bottom:1rem}
.message-content{max-width:72%}
.message-meta{font-size:0.875rem;color:#6b7280;margin-bottom:0.25rem}
.message-meta.end{text-align:end}
.message-bubble{padding:12px 14px;border-radius:18px;white-space:pre-line;word-break:break-word}
.message-bubble.mine{background:#9f2036;color:#fff;border-bottom-right-radius:6px}
.message-bubble.theirs{background:#fff;color:#111827;border:1px solid #e5e7eb;border-bottom-left-radius:6px}
.message-empty{color:#6b7280;text-align:center;padding:3rem 1rem}
.conversation-card{border:0;box-shadow:0 1px 6px rgba(16,24,40,0.06)}
.conversation-preview{min-width:72px;text-align:end}
.conversation-empty{padding:1rem;text-align:center;color:#6b7280}

.section-shell{max-width:1100px}
.section-shell-wide{max-width:980px}
.section-header{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:0.5rem;margin-bottom:1rem}
.profile-card-top{height:130px;border-top-left-radius:var(--radius);border-top-right-radius:var(--radius);background:linear-gradient(135deg,#9f2036 0%,#1f2937 100%)}

/* Dashboard and directory helpers */
.dashboard-wrap{background:transparent}
.hero-card{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;background:linear-gradient(180deg,#f6f7fb,#fff);border-radius:14px;padding:28px;box-shadow:0 8px 28px rgba(15,23,42,0.06)}
.hero-copy{min-width:0;flex:1 1 340px}
.hero-title{font-size:clamp(2rem,4vw,36px);margin:6px 0 6px;font-weight:800;line-height:1.05}
.hero-sub{color:#6b7280;max-width:60ch}
.hero-media{flex:0 0 auto;display:flex;align-items:center;justify-content:center}
.hero-media img{max-width:140px;border-radius:12px;object-fit:contain}
.dashboard-filters{display:flex;flex-wrap:wrap;gap:10px}
.filter-link{text-decoration:none}
.filter-pill{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;border-radius:999px;background:#fff;border:1px solid rgba(15,23,42,0.06);font-weight:700;color:#161616;text-decoration:none}
.filter-pill.active{background:linear-gradient(90deg,#9f2036,#7f182b);color:#fff}
.filter-pill .count{background:currentColor;color:inherit;padding:2px 8px;border-radius:999px;opacity:.15}
.filter-pill.active .count{background:#fff;color:#9f2036;opacity:1}
.table-card{border-radius:12px;overflow:hidden;box-shadow:0 10px 30px rgba(15,23,42,0.04)}
.thumb{width:44px;height:44px;background:#eee;border-radius:8px;flex-shrink:0}
.thumb-sm{width:58px;height:58px;border-radius:50%;object-fit:cover}
.avatar-fallback-sm{width:58px;height:58px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e5e7eb;color:#1f2937;font-weight:700;flex-shrink:0}
.people-card-body{display:flex;gap:12px;align-items:flex-start}
.people-card-main{flex:1 1 auto;min-width:0}
.people-card-title{font-size:1.02rem;margin:0}
.people-card-bio{font-size:0.9rem;line-height:1.45}
.people-suggestions{position:relative;z-index:50}

.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}
.stat-box{background:#fff;padding:20px;border-radius:8px;box-shadow:0 2px 8px rgba(0,0,0,0.1);text-align:center;height:100%}
.stat-label{font-size:0.9rem;color:#666;font-weight:600}
.stat-value{font-size:2rem;font-weight:700;color:#3498db;margin:10px 0}
.admin-card-icon{font-size:3rem}
.admin-card{height:100%}
.admin-card .card-body{padding-top:3rem;padding-bottom:3rem}
.admin-list-scroll{max-height:300px;overflow-y:auto}

@media (max-width: 991.98px){
  .hero-card{align-items:flex-start}
  .hero-media{order:-1;width:100%;justify-content:flex-start}
  .hero-media img{max-width:110px}
  .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width: 575.98px){
  .hero-card{padding:20px}
  .dashboard-filters{gap:8px}
  .filter-pill{width:100%;justify-content:space-between}
  .stat-grid{grid-template-columns:1fr}
  .people-card-body{flex-direction:column}
  .thumb-sm,.avatar-fallback-sm{width:52px;height:52px}
}

/* Forms and inputs */
input,textarea,select{width:100%;padding:0.5rem;border:1px solid #e6e6e6;border-radius:6px;background:transparent;font:inherit}

/* Sidebar / Navbar small-screen behavior */
.sidebar{min-width:250px}
@media (max-width: 992px){
  .sidebar{min-width:0;width:100%}
  .sidebar-collapsed{display:none}
}

/* Page header */
.page-header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 0}

/* Accessibility and focus */
:focus{outline:3px solid rgba(52,152,219,0.25);outline-offset:2px}

/* Small helpers for spacing */
.ms-1{margin-left:0.25rem}.me-1{margin-right:0.25rem}.mb-1{margin-bottom:0.25rem}

/* Make Bootstrap components inherit our base colors where appropriate */
.navbar, .bg-primary-custom{background-color:var(--primary-color) !important;color:#fff}

/* Small utility for fixed-aspect cover thumbnails that remain responsive */
.cover-thumb{width:48px;height:auto;aspect-ratio:3/4;object-fit:cover;border-radius:6px;display:block}
.cover-thumb.inline-placeholder{display:inline-flex;align-items:center;justify-content:center}

/* Preview image helper */
.img-thumb-preview{width:64px;height:96px;object-fit:cover;border-radius:8px;display:block}

/* Global responsive fixes */
:root{--navbar-height:64px;--mobile-bottom-nav-height:72px;--sidebar-width:250px}

/* Make media elements scale to container */
img, picture, video, iframe, svg { max-width:100%; height:auto; display:block; }

/* Ensure main content can shrink inside flex layouts */
.main-content{min-width:0}

/* Table responsiveness: provide scrolling rather than overflowing */
.table-responsive, .table-responsive-fix { overflow-x:auto; -webkit-overflow-scrolling:touch; width:100%; }
.table { width:100%; }
.table-card table, .card table, .table { border-collapse:collapse; }

/* Prevent fixed bottom navs from covering content on small screens */
@media (max-width: 992px){
  body{padding-bottom:calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom));}
}

@media (max-width: 1199.98px){
  .sidebar,
  .desktop-sidebar{display:none !important}

  .main-content{
    width:100% !important;
    max-width:100% !important;
    flex:0 0 100% !important;
  }
}

/* Small tweaks for chat/message heights on tiny screens */
@media (max-width: 575.98px){
  .message-thread{max-height:48vh}
}

/* Consistent button styles: unify shapes, sizes and icon buttons */
.btn{
  border-radius:12px !important;
  padding:0.5rem 0.9rem !important;
  font-weight:600 !important;
  box-shadow:none !important;
  text-transform:none !important;
  border:0 !important;
}

.btn-sm{
  padding:0.35rem 0.6rem !important;
  border-radius:10px !important;
  font-size:0.85rem !important;
}

/* Square icon buttons used across the UI */
.btn-icon{
  width:44px;height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;font-size:1rem;line-height:1;
}

/* Circular icon variant */
.btn-circle{border-radius:50% !important;width:44px;height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center}

/* Visual variants tuned for better contrast & consistency */
.btn-info{background:#00d9ee;color:#042027;border:0}
.btn-warning{background:#ffd149;color:#042027;border:0}
.btn-success{background:#2ea45e;color:#fff;border:0}
.btn-danger{background:#e04f57;color:#fff;border:0}

/* Ensure small icon-only buttons don't collapse in grid/list rows */
.btn-group .btn-icon{margin-right:0.5rem}

/* Slight hover/focus feedback consistent across variants */
.btn:focus, .btn:hover{transform:translateY(-1px);filter:brightness(0.97);transition:all 0.12s ease}


