/* =============================================================================
   AssetTrack Pro — Design System v3
   Theme: AdminLTE / Snipe-IT Inspired
   Layout: Dark fixed sidebar + light main content
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; height: 100%; }
img, video { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ── Design Tokens ──────────────────────────────────────────────────────────── */
:root {
  /* Sidebar — deep navy/charcoal like Snipe-IT */
  --sidebar-bg:        #222d32;
  --sidebar-hover:     #1e282d;
  --sidebar-active:    #1a2226;
  --sidebar-border:    rgba(255,255,255,0.05);
  --sidebar-text:      #8aa4af;
  --sidebar-text-hover:#ffffff;
  --sidebar-width:     230px;
  --sidebar-width-collapsed: 50px;

  /* Top navbar */
  --navbar-bg:         #3c8dbc;
  --navbar-height:     50px;

  /* Main content area */
  --main-bg:           #ecf0f5;
  --content-bg:        #ffffff;
  --content-border:    #d2d6de;

  /* Brand teal — Snipe-IT's signature accent */
  --teal:              #00c0ef;
  --teal-dark:         #009ec5;
  --teal-bg:           rgba(0,192,239,0.10);

  /* Action colors */
  --blue:              #3c8dbc;
  --blue-dark:         #3071a9;
  --green:             #00a65a;
  --green-dark:        #008d4c;
  --orange:            #f39c12;
  --orange-dark:       #e08e0b;
  --red:               #dd4b39;
  --red-dark:          #d43f2a;
  --purple:            #605ca8;
  --purple-dark:       #4e4b8d;
  --yellow:            #f39c12;

  /* Stat card backgrounds — Snipe-IT style */
  --card-teal:         #00c0ef;
  --card-green:        #00a65a;
  --card-orange:       #f39c12;
  --card-purple:       #605ca8;
  --card-red:          #dd4b39;
  --card-blue:         #3c8dbc;

  /* Text */
  --text-dark:         #333333;
  --text-muted:        #777777;
  --text-light:        #aaaaaa;

  /* Borders & surfaces */
  --border:            #d2d6de;
  --border-light:      #f4f4f4;
  --surface:           #ffffff;
  --surface-alt:       #f9f9f9;

  /* Typography */
  --font:      'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Radii */
  --r-sm:  3px;
  --r-md:  4px;
  --r-lg:  6px;

  /* Transitions */
  --ease: 0.15s ease;
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
html, body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-dark);
  background: var(--main-bg);
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 99px; }

/* ═════════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ============================================================================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d2d6de;
  padding: 1.5rem;
  font-family: var(--font);
}

/* Center column */
.login-box {
  width: 100%;
  max-width: 360px;
}

/* Logo / app name above card */
.login-logo {
  text-align: center;
  margin-bottom: 1.25rem;
}
.login-logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
}
.login-logo a span {
  color: var(--teal);
}
.login-logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Card */
.login-card {
  background: var(--surface);
  border: 1px solid var(--content-border);
  border-radius: var(--r-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
}

/* Card header — teal stripe like Snipe-IT login */
.login-card-header {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--content-border);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.login-card-body {
  padding: 1.25rem;
}

/* Error alert */
.login-alert {
  display: none;
  background: #f2dede;
  border: 1px solid #ebccd1;
  border-radius: var(--r-md);
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: #a94442;
  margin-bottom: 1rem;
  align-items: flex-start;
  gap: 0.5rem;
}
.login-alert.show { display: flex; }

/* Form groups */
.form-group { margin-bottom: 0.875rem; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.3125rem;
}
.form-label .icon {
  margin-right: 0.3rem;
  color: var(--text-muted);
}
.input-wrap { position: relative; }
.form-input {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-dark);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  -webkit-appearance: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.form-input::placeholder { color: #bbb; }
.form-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(0,192,239,0.15);
}
.form-input.with-toggle { padding-right: 2.5rem; }

.input-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-left: 1px solid var(--border);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  transition: background var(--ease), color var(--ease);
}
.input-toggle:hover { background: var(--surface-alt); color: var(--text-dark); }

/* Checkbox row */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 1rem;
}
.checkbox-row input { accent-color: var(--teal); width: 13px; height: 13px; cursor: pointer; }

/* Login button — full-width teal */
.btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5625rem 1rem;
  background: var(--teal);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--teal-dark);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
  letter-spacing: 0.01em;
}
.btn-login:hover:not(:disabled) { background: var(--teal-dark); }
.btn-login:disabled { opacity: 0.65; cursor: not-allowed; }

.login-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}

/* Footer links below card */
.login-footer {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
}
.login-footer a { color: var(--teal); }
.login-footer a:hover { text-decoration: underline; }

/* Version badge */
.login-version {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.7rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ═════════════════════════════════════════════════════════════════════════════
   WRAPPER LAYOUT — sidebar + content
   ============================================================================= */

.wrapper {
  display: flex;
  min-height: 100vh;
}

/* ═════════════════════════════════════════════════════════════════════════════
   TOP NAVBAR
   ============================================================================= */

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: var(--navbar-bg);
  z-index: 100;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Logo zone — sits over sidebar */
.navbar-logo {
  width: var(--sidebar-width);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: var(--sidebar-active);
  flex-shrink: 0;
  gap: 0.5rem;
}
.navbar-logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}
.navbar-logo-text span { color: var(--teal); }

/* Hamburger toggle */
.sidebar-toggle {
  width: var(--navbar-height);
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  font-size: 1.125rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--ease), color var(--ease);
}
.sidebar-toggle:hover { background: rgba(0,0,0,0.1); color: #fff; }

/* Search bar */
.navbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  max-width: 280px;
}
.navbar-search-input {
  width: 100%;
  padding: 0.3125rem 0.625rem;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 0.8125rem;
  outline: none;
}
.navbar-search-input::placeholder { color: rgba(255,255,255,0.5); }
.navbar-search-input:focus { border-color: var(--teal); background: rgba(0,0,0,0.2); }

/* Right nav actions */
.navbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: var(--navbar-height);
}
.navbar-btn {
  height: var(--navbar-height);
  padding: 0 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.navbar-btn:hover { background: rgba(0,0,0,0.1); color: #fff; }
.navbar-btn:last-child { border-right: none; }
.navbar-btn svg { flex-shrink: 0; }

/* User menu */
.user-menu {
  position: relative;
}
.user-avatar {
  width: 25px; height: 25px;
  border-radius: 50%;
  background: var(--sidebar-active);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* ═════════════════════════════════════════════════════════════════════════════
   LEFT SIDEBAR
   ============================================================================= */

.main-sidebar {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 90;
  transition: width var(--ease), transform var(--ease);
  display: flex;
  flex-direction: column;
}
.main-sidebar::-webkit-scrollbar { width: 3px; }
.main-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* Sidebar navigation */
.sidebar-nav { flex: 1; padding: 0; }
.sidebar-nav ul { padding: 0; }

/* Section header */
.sidebar-section {
  padding: 0.6875rem 1rem 0.3125rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #506470;
  border-top: 1px solid var(--sidebar-border);
  margin-top: 0.25rem;
}
.sidebar-section:first-child { border-top: none; margin-top: 0; }

/* Nav items */
.nav-item { }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  cursor: pointer;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}
.nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-hover);
}
.nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-hover);
  border-left-color: var(--teal);
}
.nav-link svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-link:hover svg,
.nav-link.active svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--teal);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* Sub-menu items */
.sub-menu {
  background: var(--sidebar-active);
}
.sub-menu .nav-link {
  padding-left: 2.25rem;
  font-size: 0.8125rem;
  color: #8aa4af;
}
.sub-menu .nav-link::before {
  content: '›';
  margin-right: -0.125rem;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.5;
}
.sub-menu .nav-link:hover,
.sub-menu .nav-link.active { color: #fff; }

/* Sidebar footer — version */
.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.6875rem;
  color: #506470;
  font-family: var(--font-mono);
}

/* ═════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ============================================================================= */

.content-wrapper {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  min-height: calc(100vh - var(--navbar-height));
  padding: 0;
  background: var(--main-bg);
  transition: margin-left var(--ease);
  flex: 1;
}

/* Page header breadcrumb bar */
.content-header {
  padding: 0.875rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--content-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.content-title {
  font-size: 1.375rem;
  font-weight: 300;
  color: var(--text-dark);
  line-height: 1.2;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb a { color: var(--blue); }
.breadcrumb a:hover { text-decoration: underline; }

/* Page body */
.content-body { padding: 1.25rem; }

/* ═════════════════════════════════════════════════════════════════════════════
   STAT CARDS — Snipe-IT colorful top row
   ============================================================================= */

.info-boxes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .info-boxes { grid-template-columns: 1fr 1fr; }
}

.info-box {
  border-radius: var(--r-md);
  display: flex;
  align-items: stretch;
  min-height: 80px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Icon side */
.info-box-icon {
  width: 70px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: rgba(0,0,0,0.12);
  color: rgba(255,255,255,0.85);
}

/* Content side */
.info-box-content {
  flex: 1;
  padding: 0.5625rem 0.75rem;
  color: #fff;
  min-width: 0;
}
.info-box-text {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.info-box-number {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  font-family: var(--font-mono);
  display: block;
}

/* Color variants */
.info-box.teal   { background: var(--card-teal); }
.info-box.green  { background: var(--card-green); }
.info-box.orange { background: var(--card-orange); }
.info-box.purple { background: var(--card-purple); }
.info-box.red    { background: var(--card-red); }
.info-box.blue   { background: var(--card-blue); }

/* ═════════════════════════════════════════════════════════════════════════════
   BOX / PANEL COMPONENT
   ============================================================================= */

.box {
  background: var(--surface);
  border: 1px solid var(--content-border);
  border-radius: var(--r-md);
  box-shadow: 0 1px 1px rgba(0,0,0,0.05);
  margin-bottom: 1.25rem;
}
.box-header {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--content-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.box-title {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-dark);
  line-height: 1;
}
.box-tools { display: flex; align-items: center; gap: 0.375rem; flex-wrap: wrap; }
.box-body { padding: 0.875rem; }
.box-footer {
  padding: 0.5rem 0.875rem;
  border-top: 1px solid var(--content-border);
  background: var(--surface-alt);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Box color stripe variants */
.box.box-teal   { border-top: 3px solid var(--card-teal); }
.box.box-blue   { border-top: 3px solid var(--card-blue); }
.box.box-green  { border-top: 3px solid var(--card-green); }
.box.box-orange { border-top: 3px solid var(--card-orange); }
.box.box-red    { border-top: 3px solid var(--card-red); }

/* ═════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ============================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 400;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), opacity var(--ease);
  white-space: nowrap;
  line-height: 1.42857;
}
.btn svg { flex-shrink: 0; }
.btn:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-default { background: #fff; color: #333; border-color: var(--border); }
.btn-default:hover { background: #f4f4f4; }

.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue-dark); }
.btn-primary:hover { background: var(--blue-dark); }

.btn-teal { background: var(--teal); color: #fff; border-color: var(--teal-dark); }
.btn-teal:hover { background: var(--teal-dark); }

.btn-success { background: var(--green); color: #fff; border-color: var(--green-dark); }
.btn-success:hover { background: var(--green-dark); }

.btn-warning { background: var(--orange); color: #fff; border-color: var(--orange-dark); }
.btn-warning:hover { background: var(--orange-dark); }

.btn-danger { background: var(--red); color: #fff; border-color: var(--red-dark); }
.btn-danger:hover { background: var(--red-dark); }

.btn-purple { background: var(--purple); color: #fff; border-color: var(--purple-dark); }
.btn-purple:hover { background: var(--purple-dark); }

.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; border-radius: var(--r-sm); }
.btn-xs { padding: 0.125rem 0.375rem; font-size: 0.6875rem; border-radius: var(--r-sm); }
.btn-lg { padding: 0.5625rem 1rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ═════════════════════════════════════════════════════════════════════════════
   TABLES
   ============================================================================= */

.table-responsive { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.table th {
  padding: 0.5rem 0.75rem;
  background: #f4f4f4;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  color: var(--text-dark);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.table th:hover { background: #ebebeb; }
.table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-dark);
  vertical-align: middle;
}
.table tbody tr:hover { background: #f9f9f9; }
.table tbody tr:last-child td { border-bottom: none; }

/* Status dot */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 0.375rem;
  flex-shrink: 0;
}
.status-dot.available  { background: var(--green); }
.status-dot.assigned   { background: var(--blue); }
.status-dot.maintenance{ background: var(--orange); }
.status-dot.disposed   { background: var(--red); }

/* Row action buttons cluster */
.row-actions { display: flex; gap: 0.25rem; align-items: center; flex-wrap: nowrap; }

/* ═════════════════════════════════════════════════════════════════════════════
   SCANNER / QR SECTION
   ============================================================================= */

.scanner-box {
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  aspect-ratio: 1 / 1;
  max-height: 260px;
  border: 1px solid var(--border);
}
#qr-reader              { width: 100% !important; border: none !important; }
#qr-reader video        { width: 100% !important; height: 100% !important; object-fit: cover; border-radius: 0 !important; }
#qr-reader__scan_region { border: 2px solid var(--teal) !important; border-radius: 3px !important; }

.scan-corner {
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--teal);
  border-style: solid; border-width: 0;
  pointer-events: none;
}
.scan-corner-tl { top:10px; left:10px;   border-top-width:2px;    border-left-width:2px;  border-radius:2px 0 0 0; }
.scan-corner-tr { top:10px; right:10px;  border-top-width:2px;    border-right-width:2px; border-radius:0 2px 0 0; }
.scan-corner-bl { bottom:10px; left:10px;  border-bottom-width:2px; border-left-width:2px;  border-radius:0 0 0 2px; }
.scan-corner-br { bottom:10px; right:10px; border-bottom-width:2px; border-right-width:2px; border-radius:0 0 2px 0; }

/* ═════════════════════════════════════════════════════════════════════════════
   FORM CONTROLS (dashboard forms)
   ============================================================================= */

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .form-input {
  border-radius: var(--r-md) 0 0 var(--r-md);
  border-right: none;
  flex: 1;
}
.input-group .btn {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  border-left: none;
}
.input-group-icon {
  display: flex;
  align-items: center;
  padding: 0 0.625rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--r-md) 0 0 var(--r-md);
  border-right: none;
  color: var(--text-muted);
}
.input-group-icon + .form-input {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  border-left: none;
}

/* Standalone search input */
.search-input {
  width: 100%;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  background: #fff;
  color: var(--text-dark);
  transition: border-color var(--ease);
}
.search-input:focus { border-color: var(--teal); }
.search-input::placeholder { color: #bbb; }

/* ═════════════════════════════════════════════════════════════════════════════
   ALERTS / BADGES
   ============================================================================= */

.alert {
  padding: 0.625rem 0.875rem;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.alert-success { background: #dff0d8; border-color: #d6e9c6; color: #3c763d; }
.alert-info    { background: #d9edf7; border-color: #bce8f1; color: #31708f; }
.alert-warning { background: #fcf8e3; border-color: #faebcc; color: #8a6d3b; }
.alert-danger  { background: #f2dede; border-color: #ebccd1; color: #a94442; }

.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 99px;
  white-space: nowrap;
}
.badge-success { background: var(--green);  color: #fff; }
.badge-info    { background: var(--teal);   color: #fff; }
.badge-warning { background: var(--orange); color: #fff; }
.badge-danger  { background: var(--red);    color: #fff; }
.badge-default { background: #d2d6de;       color: #555; }
.badge-primary { background: var(--blue);   color: #fff; }

/* ═════════════════════════════════════════════════════════════════════════════
   MODALS
   ============================================================================= */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}
/* Bottom sheet — mobile asset detail */
.modal-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 151;
  background: var(--surface);
  border-radius: 8px 8px 0 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 20px rgba(0,0,0,0.15);
  max-height: 88vh;
  overflow-y: auto;
}
.modal-sheet-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin: 0.75rem auto 0;
}
.modal-sheet-header {
  padding: 0.875rem 1.125rem 0.625rem;
  border-bottom: 1px solid var(--content-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.modal-sheet-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-sheet-body { padding: 0.875rem 1.125rem 1.5rem; }

/* Centered modal (signatures) */
.modal-center {
  position: fixed; inset: 0; z-index: 160;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,0.55);
}
.modal-dialog {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}
.modal-dialog-header {
  background: var(--blue);
  color: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-dialog-title { font-size: 0.9375rem; font-weight: 600; }
.modal-dialog-body { padding: 1rem; }
.modal-dialog-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Detail rows in asset modal */
.detail-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; margin-bottom: 0.875rem; }
.detail-table td { padding: 0.375rem 0; border-bottom: 1px solid var(--border-light); }
.detail-table td:first-child { color: var(--text-muted); width: 40%; font-weight: 600; }
.detail-table td:last-child  { color: var(--text-dark); }
.detail-table tr:last-child td { border-bottom: none; }

/* ═════════════════════════════════════════════════════════════════════════════
   SIGNATURE PAD
   ============================================================================= */

.sig-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
  margin-bottom: 0.5rem;
}
#signature-canvas {
  width: 100%; height: 140px;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ═════════════════════════════════════════════════════════════════════════════
   SKELETON LOADERS
   ============================================================================= */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer { 0%{background-position:-200% 0} 100%{background-position:200% 0} }

/* ═════════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ============================================================================= */

.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 0.75rem);
  right: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.625rem 1rem;
  border-radius: var(--r-md);
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  animation: slideInRight 0.2s ease;
  max-width: 280px;
  word-break: break-word;
}
.toast-success { background: var(--green);  color: #fff; }
.toast-error   { background: var(--red);    color: #fff; }
.toast-info    { background: var(--teal);   color: #fff; }
.toast-warning { background: var(--orange); color: #fff; }

/* ═════════════════════════════════════════════════════════════════════════════
   OFFLINE BANNER
   ============================================================================= */

.offline-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--orange);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  z-index: 180;
}

/* ═════════════════════════════════════════════════════════════════════════════
   PAGINATION
   ============================================================================= */

.pagination { display: flex; align-items: center; gap: 0.25rem; }
.page-btn {
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--text-dark);
  cursor: pointer;
  transition: background var(--ease);
}
.page-btn:hover { background: var(--surface-alt); }
.page-btn.active { background: var(--blue); color: #fff; border-color: var(--blue-dark); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═════════════════════════════════════════════════════════════════════════════
   ANIMATIONS & UTILITIES
   ============================================================================= */

@keyframes spin        { to { transform: rotate(360deg); } }
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shake {
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-5px)}
  75%{transform:translateX(5px)}
}

.modal-enter { animation: slideUp 0.22s ease; }

.hidden  { display: none !important; }
.visible { display: block !important; }
.flex    { display: flex !important; }
.truncate { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mono    { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-teal  { color: var(--teal); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.text-blue  { color: var(--blue); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.min-w-0 { min-width: 0; }
.flex-1  { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ═════════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ============================================================================= */

@media (max-width: 767px) {
  .main-sidebar {
    transform: translateX(-100%);
  }
  .main-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 16px rgba(0,0,0,0.3);
  }
  .content-wrapper {
    margin-left: 0;
  }
  .navbar-logo {
    width: auto;
    padding: 0 0.75rem;
  }
  .navbar-search {
    display: none;
  }
  .info-boxes {
    grid-template-columns: 1fr 1fr;
  }
  .content-body { padding: 0.875rem; }

  /* Sidebar overlay */
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 89;
  }
  .sidebar-overlay.show { display: block; }
}

@media (min-width: 768px) {
  .sidebar-overlay { display: none !important; }
}
