/* ═══════════════════════════════════════════════════════════════════════════
   LABCORE — Global Stylesheet
   Palette:
     Page bg      : #f0f2f5  (cool light grey)
     Navbar       : #0f172a  (deep navy)
     Card bg      : #ffffff
     Card header  : gradient indigo → blue
     Accent blue  : #1d4ed8
     Accent teal  : #0891b2
     Text primary : #1e293b
     Text muted   : #64748b
     Border       : #e2e8f0
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Font ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset / Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(160deg, #e8edf5 0%, #dde6f0 40%, #e4eaf4 100%);
  background-attachment: fixed;
  color: #1e293b;
  font-size: 0.9375rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  width: 100%;
}

footer.footer {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto !important;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
  background: #0f172a !important;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: .55rem 0;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.3px;
  color: #f8fafc !important;
}
.navbar-brand i { color: #60a5fa; margin-right: .35rem; }

.navbar-nav .nav-link {
  color: #cbd5e1 !important;
  font-weight: 500;
  font-size: .875rem;
  padding: .45rem .75rem !important;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #f8fafc !important;
  background: rgba(255,255,255,.08);
}

/* Dropdown menus */
.dropdown-menu {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
  padding: .4rem;
  animation: dropIn .15s ease-out;
  background: #fff;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-item {
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  color: #334155;
  padding: .45rem .85rem;
  transition: background .12s, color .12s;
}
.dropdown-item:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.dropdown-divider { border-color: #f1f5f9; margin: .3rem 0; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: #ffffff;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(30,58,138,.07), 0 8px 24px rgba(30,58,138,.05);
  margin-bottom: 1.25rem;
  transition: box-shadow .2s, transform .2s;
}
.card:hover {
  box-shadow: 0 4px 16px rgba(30,58,138,.1), 0 16px 40px rgba(30,58,138,.08);
  transform: translateY(-3px);
}

.card-header {
  background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 55%, #0891b2 100%);
  color: #fff;
  border: none;
  border-radius: 14px 14px 0 0 !important;
  font-weight: 700;
  font-size: .9rem;
  padding: .85rem 1.2rem;
  letter-spacing: .1px;
}
.card-header.bg-primary   { background: linear-gradient(120deg,#1e3a8a,#1d4ed8,#0891b2) !important; }
.card-header.bg-success   { background: linear-gradient(120deg,#14532d,#16a34a,#059669) !important; }
.card-header.bg-warning   { background: linear-gradient(120deg,#78350f,#d97706,#f59e0b) !important; }
.card-header.bg-danger    { background: linear-gradient(120deg,#7f1d1d,#dc2626,#e11d48) !important; }
.card-header.bg-info      { background: linear-gradient(120deg,#0c4a6e,#0284c7,#06b6d4) !important; }
.card-header.bg-secondary { background: linear-gradient(120deg,#1e293b,#475569,#64748b) !important; }
.card-header.bg-dark      { background: linear-gradient(120deg,#0f172a,#1e293b,#334155) !important; }
.card-header.bg-light     { background: #f8fafc !important; color: #1e293b !important; border-bottom: 1px solid #e2e8f0 !important; }

.card-body { padding: 1.2rem; }
.card-footer {
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  border-radius: 0 0 14px 14px !important;
  padding: .75rem 1.2rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table {
  font-size: .875rem;
  color: #334155;
}
.table th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid #e2e8f0;
  padding: .7rem 1rem;
  white-space: nowrap;
}
.table td {
  padding: .75rem 1rem;
  vertical-align: middle;
  border-color: #f1f5f9;
}
.table-hover tbody tr:hover { background: #f8fafc; }
.table-striped tbody tr:nth-of-type(odd) { background: #fafbfc; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: .9rem;
  color: #1e293b;
  background: #f8fafc;
  padding: .55rem .9rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.form-control:focus, .form-select:focus {
  border-color: #1d4ed8;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(29,78,216,.1);
  outline: none;
}
.form-label {
  font-weight: 600;
  font-size: .82rem;
  color: #475569;
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-text { color: #94a3b8; font-size: .78rem; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  border-radius: 10px;
  font-weight: 600;
  font-size: .875rem;
  padding: .5rem 1.1rem;
  transition: all .18s;
  border: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.btn:active { transform: translateY(0); }

.btn-primary   { background: linear-gradient(135deg,#1d4ed8,#2563eb); color:#fff; }
.btn-success   { background: linear-gradient(135deg,#15803d,#16a34a); color:#fff; }
.btn-danger    { background: linear-gradient(135deg,#b91c1c,#dc2626); color:#fff; }
.btn-warning   { background: linear-gradient(135deg,#b45309,#d97706); color:#fff; }
.btn-info      { background: linear-gradient(135deg,#0369a1,#0284c7); color:#fff; }
.btn-secondary { background: linear-gradient(135deg,#334155,#475569); color:#fff; }
.btn-dark      { background: linear-gradient(135deg,#0f172a,#1e293b); color:#fff; }
.btn-light     { background: #f1f5f9; color: #334155; border: 1.5px solid #e2e8f0; }
.btn-light:hover { background: #e2e8f0; }

.btn-outline-primary   { border: 1.5px solid #1d4ed8; color: #1d4ed8; background: transparent; }
.btn-outline-primary:hover   { background: #eff6ff; }
.btn-outline-success   { border: 1.5px solid #16a34a; color: #16a34a; background: transparent; }
.btn-outline-success:hover   { background: #f0fdf4; }
.btn-outline-danger    { border: 1.5px solid #dc2626; color: #dc2626; background: transparent; }
.btn-outline-danger:hover    { background: #fef2f2; }
.btn-outline-secondary { border: 1.5px solid #94a3b8; color: #475569; background: transparent; }
.btn-outline-secondary:hover { background: #f8fafc; }
.btn-outline-info      { border: 1.5px solid #0284c7; color: #0284c7; background: transparent; }
.btn-outline-info:hover      { background: #f0f9ff; }
.btn-outline-warning   { border: 1.5px solid #d97706; color: #d97706; background: transparent; }
.btn-outline-warning:hover   { background: #fffbeb; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  font-weight: 700;
  font-size: .72rem;
  padding: .3em .65em;
  border-radius: 6px;
  letter-spacing: .2px;
}
.bg-primary   { background: #1d4ed8 !important; }
.bg-success   { background: #16a34a !important; }
.bg-danger    { background: #dc2626 !important; }
.bg-warning   { background: #d97706 !important; }
.bg-info      { background: #0284c7 !important; }
.bg-secondary { background: #64748b !important; }
.bg-dark      { background: #1e293b !important; }
.bg-light     { background: #f1f5f9 !important; color: #475569 !important; }

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  border: none;
  border-radius: 12px;
  font-size: .875rem;
  font-weight: 500;
  padding: .85rem 1.1rem;
  border-left: 4px solid transparent;
}
.alert-success  { background: #f0fdf4; color: #15803d; border-left-color: #16a34a; }
.alert-danger   { background: #fef2f2; color: #b91c1c; border-left-color: #dc2626; }
.alert-warning  { background: #fffbeb; color: #b45309; border-left-color: #d97706; }
.alert-info     { background: #eff6ff; color: #1d4ed8; border-left-color: #2563eb; }
.alert-primary  { background: #eff6ff; color: #1d4ed8; border-left-color: #1d4ed8; }
.alert-secondary{ background: #f8fafc; color: #475569; border-left-color: #94a3b8; }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: .75rem;
  font-size: .8rem;
}
.breadcrumb-item a { color: #1d4ed8; text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: #64748b; }
.breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  color: #94a3b8;
  font-size: .8rem;
  padding: .85rem 0;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Notification bell ───────────────────────────────────────────────────── */
.navbar-nav .fa-bell {
  font-size: 1.15rem;
  margin: 0 .4rem;
  transition: transform .3s cubic-bezier(.68,-.55,.27,1.55), color .2s;
}
.navbar-nav .fa-bell:hover {
  color: #fbbf24;
  animation: bell-ring .7s cubic-bezier(.68,-.55,.27,1.55);
}
@keyframes bell-ring {
  0%   { transform: rotate(0); }
  10%  { transform: rotate(-15deg); }
  20%  { transform: rotate(10deg); }
  30%  { transform: rotate(-10deg); }
  40%  { transform: rotate(6deg); }
  50%  { transform: rotate(-4deg); }
  60%  { transform: rotate(2deg); }
  70%  { transform: rotate(-1deg); }
  80%  { transform: rotate(1deg); }
  90%  { transform: rotate(-1deg); }
  100% { transform: rotate(0); }
}

/* ── Focus ring ──────────────────────────────────────────────────────────── */
.btn:focus, .form-control:focus, .form-select:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* ── Responsive & Mobile Layout Optimization ────────────────────────────── */
@media (max-width: 991.98px) {
  .navbar .navbar-collapse {
    background: #0f172a;
    padding: .85rem 1.1rem;
    border-radius: 0 0 14px 14px;
    border-top: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
  }
  .navbar-nav .nav-link { 
    font-size: 0.95rem; 
    padding: .65rem .85rem !important; 
    margin-bottom: 2px;
  }
  .navbar .dropdown-menu {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: none;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }
  .navbar .dropdown-item {
    color: #cbd5e1;
  }
  .navbar .dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 0.9rem;
  }
  .container, .container-fluid { 
    padding-left: .85rem; 
    padding-right: .85rem; 
  }
  .card { 
    margin-bottom: 1rem; 
    border-radius: 12px;
  }
  .card-header { 
    font-size: .85rem; 
    padding: .75rem 1rem; 
  }
  .card-body { 
    padding: 1rem; 
  }
  .card-footer {
    padding: .65rem 1rem;
  }
  
  /* Tables Touch Scroll */
  .table { 
    font-size: .82rem; 
    margin-bottom: 0;
  }
  .table th, .table td {
    padding: .6rem .75rem;
    white-space: nowrap;
  }
  .table-responsive { 
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    border-radius: 8px;
    margin-bottom: 0.5rem;
  }

  /* Form & Button Sizing for Touch */
  .btn { 
    font-size: .85rem; 
    padding: .5rem .9rem; 
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
  }
  .btn-sm {
    min-height: 34px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
  }
  .form-control, .form-select { 
    font-size: .92rem; 
    min-height: 42px;
    padding: .5rem .85rem;
  }
  .form-label {
    font-size: .78rem;
    margin-bottom: .25rem;
  }

  /* Modals */
  .modal-dialog {
    margin: 0.5rem auto;
    max-width: calc(100% - 1rem);
  }
  .modal-content {
    border-radius: 16px;
  }
  .modal-header {
    padding: 1rem 1.25rem 0.5rem;
  }
  .modal-body {
    padding: 1rem 1.25rem;
    max-height: calc(85vh - 120px);
    overflow-y: auto;
  }
  .modal-footer {
    padding: 0.75rem 1.25rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .modal-footer > * {
    margin: 0 !important;
  }
}

@media (max-width: 576px) {
  .navbar-brand { font-size: 1.05rem; }
  .badge { font-size: .72em; }
  .footer { font-size: .75rem; padding: .65rem 0; }
  
  /* Prevent text clipping and overflow */
  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.3rem; }
  h3, .h3 { font-size: 1.15rem; }
  h4, .h4 { font-size: 1.05rem; }
  h5, .h5 { font-size: 0.95rem; }
  
  /* Button stacks on small mobile */
  .d-flex.justify-content-between.align-items-center {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .btn-group {
    display: flex;
    flex-wrap: wrap;
  }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  .container { width: 100%; max-width: 100%; padding: 0; margin: 0; }
  .card { border: none; box-shadow: none; }
}
