/*
 * Kino Biotech: page layout and look for the IT systems (mismgmt, ITS).
 * Our own stylesheet, built on Bootstrap 5. Loaded by header.php before kino.css.
 * Layout: fixed top bar, left menu (hidden behind a button on narrow screens), content area.
 */

:root {
  --app-bg: #f3f5f9;
  --app-surface: #ffffff;
  --app-border: #e3e8ef;
  --app-text: #1f2d3d;
  --app-muted: #6b7a90;
  --app-faint: #9aa7b8;
  --app-primary: #2a78d6;
  --app-primary-dark: #1f5fae;
  --app-primary-soft: #e9f1fc;
  --app-hover: #f1f4f9;
  --app-header-h: 56px;
  --app-sidebar-w: 250px;
  --app-radius: 10px;
  --app-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --bs-primary: #2a78d6;
  --bs-primary-rgb: 42, 120, 214;
  --bs-link-color: #2a78d6;
  --bs-link-color-rgb: 42, 120, 214;
  --bs-link-hover-color: #1f5fae;
  --bs-link-hover-color-rgb: 31, 95, 174;
  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--bs-body-font-family);
  font-size: 14px;
}
a { color: var(--app-primary); text-decoration: none; }
a:hover { color: var(--app-primary-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--app-text); }

.btn-primary { --bs-btn-bg: #2a78d6; --bs-btn-border-color: #2a78d6; --bs-btn-hover-bg: #1f5fae; --bs-btn-hover-border-color: #1f5fae;
  --bs-btn-active-bg: #1a5297; --bs-btn-active-border-color: #1a5297; --bs-btn-disabled-bg: #2a78d6; --bs-btn-disabled-border-color: #2a78d6; }
.btn-outline-primary { --bs-btn-color: #2a78d6; --bs-btn-border-color: #2a78d6; --bs-btn-hover-bg: #2a78d6; --bs-btn-hover-border-color: #2a78d6;
  --bs-btn-active-bg: #1f5fae; --bs-btn-active-border-color: #1f5fae; }
.form-control:focus, .form-select:focus { border-color: #8db7ea; box-shadow: 0 0 0 .2rem rgba(42, 120, 214, .15); }

/* ---- top bar ---- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 997;
  height: var(--app-header-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}
.app-menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 0; border-radius: 8px;
  background: transparent; color: var(--app-text); font-size: 24px;
}
.app-menu-btn:hover { background: var(--app-hover); }
.app-brand { display: flex; align-items: center; gap: 8px; color: var(--app-text); font-weight: 700; font-size: 17px; }
.app-brand:hover { color: var(--app-text); }
.app-brand img { height: 28px; width: auto; }
.app-system { color: var(--app-muted); font-size: 13px; padding-left: 12px; border-left: 1px solid var(--app-border); }
/* "All systems": back to the apps home page (the tiles of every system), just before the person's name */
.app-home-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--app-border); border-radius: 8px;
  color: var(--app-text); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.app-home-btn .bi { color: var(--app-primary); font-size: 16px; }
.app-home-btn:hover { background: var(--app-hover); color: var(--app-text); }
.app-user { margin-left: auto; }
.app-home-btn + .app-user { margin-left: 0; }
@media (max-width: 575.98px) {
  .app-home-btn { padding: 6px 9px; }
  .app-home-btn span { display: none; }
}
.app-user-btn {
  display: flex; align-items: center; gap: 8px;
  border: 0; background: transparent; color: var(--app-text);
  padding: 4px 8px; border-radius: 8px; font-size: 14px;
}
.app-user-btn:hover { background: var(--app-hover); }
.app-user-btn .bi { font-size: 12px; color: var(--app-muted); }
.app-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--app-primary-soft); color: var(--app-primary);
  font-size: 12px; font-weight: 700;
}
.app-user .dropdown-menu { min-width: 220px; border-color: var(--app-border); box-shadow: 0 8px 24px rgba(16, 24, 40, .08); }
.app-user .dropdown-header { color: var(--app-text); white-space: normal; }
.app-user .dropdown-header span { display: block; color: var(--app-muted); font-size: 12px; }

/* ---- left menu ---- */
.app-sidebar {
  position: fixed; top: var(--app-header-h); left: 0; bottom: 0; z-index: 996;
  width: var(--app-sidebar-w);
  padding: 12px 10px 24px;
  overflow-y: auto;
  background: var(--app-surface);
  border-right: 1px solid var(--app-border);
  transition: transform .2s ease;
}
.app-nav, .app-nav ul { list-style: none; margin: 0; padding: 0; }
.app-nav > li { margin-bottom: 2px; }
.app-nav .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--app-text); font-weight: 500; font-size: 14px;
}
.app-nav .nav-link > i:first-child, .app-nav .nav-link > .bx { font-size: 18px; color: var(--app-muted); }
.app-nav .nav-link:hover { background: var(--app-hover); }
.app-nav .nav-link:not(.collapsed) { background: var(--app-primary-soft); color: var(--app-primary); }
.app-nav .nav-link:not(.collapsed) > i:first-child, .app-nav .nav-link:not(.collapsed) > .bx { color: var(--app-primary); }
.app-nav .nav-link .bi-chevron-down { margin-left: auto; font-size: 12px; transition: transform .2s; }
.app-nav .nav-link:not(.collapsed) .bi-chevron-down { transform: rotate(180deg); }
.app-nav .nav-content { padding: 4px 0 8px; }
.app-nav .nav-content a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 40px; border-radius: 6px;
  color: var(--app-muted); font-size: 13.5px;
}
.app-nav .nav-content a > .bi-circle { display: none; }
.app-nav .nav-content a:hover { color: var(--app-text); background: var(--app-hover); }
.app-nav .nav-content a.active { color: var(--app-primary); font-weight: 600; }
/* menu counts: one size whatever the number (sidebar.php shows 99+ above 99) */
.app-nav .nav-content a .badge {
  margin-left: auto; flex: 0 0 auto;
  width: 28px; height: 18px; padding: 0;
  font-size: 11px; line-height: 18px; text-align: center; border-radius: 9px;
}
.app-nav .nav-heading { padding: 14px 12px 6px; color: var(--app-faint); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* dimmed page behind the menu on narrow screens (added by app.js) */
.app-backdrop { position: fixed; inset: var(--app-header-h) 0 0 0; z-index: 995; background: rgba(16, 24, 40, .35); }

/* ---- content area ---- */
#main { margin-top: var(--app-header-h); padding: 20px 24px; transition: margin .2s ease; }
.app-footer {
  padding: 18px 24px; border-top: 1px solid var(--app-border);
  color: var(--app-faint); font-size: 12px; text-align: center;
  transition: margin .2s ease;
}

/* wide screens: menu always there unless hidden with the button */
@media (min-width: 1200px) {
  #main, .app-footer { margin-left: var(--app-sidebar-w); }
  body.sidebar-hidden .app-sidebar { transform: translateX(-100%); }
  body.sidebar-hidden #main, body.sidebar-hidden .app-footer { margin-left: 0; }
}
/* narrow screens: menu slides in over the page */
@media (max-width: 1199.98px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: 0 0 24px rgba(16, 24, 40, .12); }
  body.sidebar-open .app-sidebar { transform: none; }
  #main { padding: 16px; }
  .app-system { display: none; }
}

/* ---- page title ---- */
.pagetitle { margin-bottom: 16px; }
.pagetitle h1 { font-size: 22px; font-weight: 700; margin: 0 0 2px; }
.breadcrumb { margin: 0; font-size: 13px; --bs-breadcrumb-divider-color: var(--app-faint); --bs-breadcrumb-item-active-color: var(--app-muted); }
.breadcrumb a { color: var(--app-muted); }
.breadcrumb a:hover { color: var(--app-primary); }

/* ---- cards ---- */
.card {
  margin-bottom: 20px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
}
.card-header, .card-footer { background: var(--app-surface); border-color: var(--app-border); padding: 14px 20px; }
.card-header h4 { font-size: 18px; margin: 0; }
.card-footer { color: var(--app-muted); font-size: 13px; }
.card-body { padding: 0 20px 20px; }
.card-body.pt-3 { padding-top: 20px !important; }
.card-title { padding: 18px 0 12px; margin: 0; font-size: 16px; font-weight: 600; color: var(--app-text); }
.card-title span { color: var(--app-muted); font-size: 13px; font-weight: 400; }
.card-title a { color: inherit; }

/* number cards (IT Management home) */
.info-card h6 { margin: 0; font-size: 26px; font-weight: 700; color: var(--app-text); }
.card-icon {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%;
  font-size: 24px; background: var(--app-primary-soft); color: var(--app-primary);
}
.revenue-card .card-icon { background: #e4f6ec; color: #198754; }
.customers-card .card-icon { background: #fdeee6; color: #d9622b; }

/* tables */
.table { --bs-table-color: var(--app-text); margin-bottom: 0; }
.table > thead th { color: var(--app-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; border-bottom-color: var(--app-border); }
.table > :not(caption) > * > * { padding: 10px 8px; border-bottom-color: #eef1f6; }
.recent-sales .table th[scope="row"] { font-weight: 600; white-space: nowrap; }

/* "recent activity" lists (Barcode and QR Code pages) */
.activity { font-size: 13px; }
.activity-item { gap: 10px; padding-bottom: 14px; }
.activite-label { flex: 0 0 76px; color: var(--app-muted); font-size: 12px; line-height: 1.35; }
.activity-badge { flex: 0 0 auto; margin-top: 3px; font-size: 10px; }
.activity-content { color: var(--app-text); }

/* person lists (request pages) */
.news .post-item { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.news .post-item h4 { font-size: 15px; margin: 0 0 2px; }
.news .post-item p { margin: 0; color: var(--app-muted); font-size: 13px; }

/* back to top */
.back-to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 99;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--app-primary); color: #fff; font-size: 24px;
  opacity: 0; visibility: hidden; transition: opacity .2s;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--app-primary-dark); color: #fff; }

/* ---- sign-in page ---- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; color: var(--app-text); font-weight: 700; font-size: 20px; }
.auth-brand img { height: 36px; }
.auth-box .card-body { padding: 28px; }
.auth-box h1 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.auth-box .auth-sub { color: var(--app-muted); margin-bottom: 20px; }
.auth-foot { margin-top: 14px; text-align: center; color: var(--app-faint); font-size: 12px; }
.news .app-avatar { flex: 0 0 40px; width: 40px; height: 40px; font-size: 13px; }
