/* ═══════════════════════════════════════════════════════════════════
   AssetTrack — Modern UI  (font sizes bumped to 16px base)
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

:root {
  --sb-width:230px;
  --sb-bg:#0f1117;
  --sb-border:rgba(255,255,255,.07);
  --sb-text:#8b95a8;
  --sb-text-active:#ffffff;
  --sb-hover-bg:rgba(255,255,255,.06);
  --sb-active-bg:rgba(99,179,237,.1);
  --sb-active-line:#63b3ed;
  --bg-page:#f2f5fa;
  --bg-card:#ffffff;
  --bg-card-alt:#f7f9fc;
  --text-primary:#1a1d23;
  --text-secondary:#5c6470;
  --text-muted:#9aa0ac;
  --accent:#2563eb;
  --accent-light:#eff6ff;
  --accent-hover:#1d4ed8;
  --border:#e5e9f0;
  --border-strong:#ccd3de;
  --shadow-sm:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --shadow-md:0 4px 14px rgba(0,0,0,.08),0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:0 10px 28px rgba(0,0,0,.10),0 4px 10px rgba(0,0,0,.05);
  --radius-sm:6px;
  --radius-md:10px;
  --radius-lg:14px;
  --radius-xl:18px;
}

*,*::before,*::after{box-sizing:border-box}

/* Base: 16px = comfortable reading size */
html { font-size: 16px; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.9375rem;   /* 15px */
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  display: flex;
  padding-top: 0 !important;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ── */
.at-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sb-width);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  display: flex; flex-direction: column;
  z-index: 1040; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  transition: transform .25s ease;
}
.at-sidebar::-webkit-scrollbar { display: none; }

.at-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sb-border);
  text-decoration: none;
}
.at-brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg,#3b82f6,#1d4ed8);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.05rem; flex-shrink: 0;
}
.at-brand-name { font-size: 1rem; font-weight: 600; color: #fff; letter-spacing: -.01em; }

.at-nav-section { padding: 14px 10px 4px; flex-shrink: 0; }
.at-nav-label {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase;
  color: rgba(255,255,255,.22);
  padding: 0 9px; margin-bottom: 4px;
}
.at-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--sb-text); text-decoration: none;
  font-size: 0.875rem;   /* 14px */
  font-weight: 400;
  transition: background .15s, color .15s;
  position: relative; white-space: nowrap;
}
.at-nav-link i { font-size: 1rem; flex-shrink: 0; width: 16px; text-align: center; }
.at-nav-link:hover { background: var(--sb-hover-bg); color: var(--sb-text-active); }
.at-nav-link.active {
  background: var(--sb-active-bg);
  color: var(--sb-text-active); font-weight: 500;
}
.at-nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; background: var(--sb-active-line); border-radius: 0 3px 3px 0;
}

.at-nav-group-toggle { cursor: pointer; user-select: none; }
.at-nav-group-toggle .at-caret { margin-left: auto; font-size: .65rem; opacity: .4; transition: transform .2s; }
.at-nav-group-toggle.open .at-caret { transform: rotate(90deg); }
.at-nav-sub { padding-left: 26px; max-height: 0; overflow: hidden; transition: max-height .22s ease; }
.at-nav-sub.open { max-height: 300px; }
.at-nav-sub .at-nav-link { font-size: 0.8125rem; padding: 6px 9px; } /* 13px */

.at-sb-user {
  margin-top: auto; border-top: 1px solid var(--sb-border);
  padding: 13px 15px; display: flex; align-items: center; gap: 10px;
}
.at-sb-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg,#3b82f6,#7c3aed);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; flex-shrink: 0;
}
.at-sb-user-name { font-size: 0.8125rem; color: #fff; font-weight: 500; line-height: 1.25; }
.at-sb-user-role { font-size: 0.72rem; color: var(--sb-text); }
.at-sb-logout { margin-left: auto; color: var(--sb-text); font-size: 1rem; text-decoration: none; transition: color .15s; flex-shrink: 0; }
.at-sb-logout:hover { color: #ef4444; }

.at-sidebar-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 1050;
  background: var(--sb-bg); border: 1px solid var(--sb-border);
  color: #fff; border-radius: 8px; width: 38px; height: 38px;
  align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem;
}
.at-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1039; }

/* ── Main wrap ── */
.at-main-wrap { margin-left: var(--sb-width); flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.at-content { flex: 1; padding: 28px 30px 20px; width: 100%; max-width: 1400px; }

/* ── Page header ── */
.at-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 12px; flex-wrap: wrap;
}
.at-page-title { font-size: 1.4rem; font-weight: 600; letter-spacing: -.025em; color: var(--text-primary); margin: 0; }

/* ── Cards ── */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: box-shadow .2s;
}
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 13px 18px !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  font-size: 0.875rem;   /* 14px */
  font-weight: 600; color: var(--text-primary); letter-spacing: -.01em;
}
.card-body { padding: 20px !important; }
.card-footer {
  background: var(--bg-card-alt) !important;
  border-top: 1px solid var(--border) !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
  padding: 11px 18px !important;
}

/* Stat cards */
.at-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 22px;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 16px;
  transition: box-shadow .2s, transform .2s;
}
.at-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.at-stat-icon {
  width: 46px; height: 46px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.at-stat-value { font-size: 1.75rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.at-stat-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 4px; }  /* 13px */

/* ── Tables ── */
.table { font-size: 0.875rem; color: var(--text-primary); margin-bottom: 0; }  /* 14px */
.table > :not(caption) > * > * { padding: 11px 15px !important; vertical-align: middle; border-color: var(--border) !important; }
.table thead th {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted);
  background: var(--bg-card-alt) !important;
  border-bottom: 1px solid var(--border) !important; white-space: nowrap;
}
.table-hover tbody tr:hover td { background: #f5f8ff !important; }

/* ── Buttons ── */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;   /* 14px */
  font-weight: 500; border-radius: var(--radius-sm);
  padding: .44rem .9rem; letter-spacing: -.01em; transition: all .15s;
}
.btn-primary {
  background: var(--accent) !important; border-color: var(--accent) !important;
  color: #fff !important; box-shadow: 0 1px 4px rgba(37,99,235,.3) !important;
}
.btn-primary:hover {
  background: var(--accent-hover) !important; border-color: var(--accent-hover) !important;
  box-shadow: 0 3px 10px rgba(37,99,235,.35) !important; transform: translateY(-1px);
}
.btn-outline-primary { color: var(--accent) !important; border-color: var(--accent) !important; background: transparent !important; }
.btn-outline-primary:hover { background: var(--accent) !important; color: #fff !important; }
.btn-outline-secondary { color: var(--text-secondary) !important; border-color: var(--border-strong) !important; background: transparent !important; }
.btn-outline-secondary:hover { background: var(--bg-card-alt) !important; color: var(--text-primary) !important; }
.btn-outline-danger { color: #dc2626 !important; border-color: #fca5a5 !important; background: transparent !important; }
.btn-outline-danger:hover { background: #fee2e2 !important; border-color: #dc2626 !important; }
.btn-success { background: #059669 !important; border-color: #059669 !important; color: #fff !important; }
.btn-success:hover { background: #047857 !important; border-color: #047857 !important; }
.btn-outline-success { color: #059669 !important; border-color: #6ee7b7 !important; background: transparent !important; }
.btn-outline-success:hover { background: #f0fdf4 !important; border-color: #059669 !important; }
.btn-outline-warning { color: #d97706 !important; border-color: #fcd34d !important; background: transparent !important; }
.btn-outline-warning:hover { background: #fffbeb !important; border-color: #d97706 !important; }
.btn-sm { font-size: 0.8125rem; padding: .32rem .72rem; border-radius: 5px; }  /* 13px */

/* ── Forms ── */
.form-control, .form-select {
  font-family: 'DM Sans', sans-serif; font-size: 0.9375rem;  /* 15px */
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: .46rem .78rem; color: var(--text-primary); background: var(--bg-card);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); outline: none;
}
.form-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; letter-spacing: -.01em; }  /* 13px */
.input-group-text { background: var(--bg-card-alt); border-color: var(--border-strong); color: var(--text-muted); font-size: 0.875rem; }
.form-text { font-size: 0.78rem; color: var(--text-muted); }
.form-check-input:checked { background-color: var(--accent) !important; border-color: var(--accent) !important; }
.invalid-feedback { font-size: 0.8125rem; }

/* ── Badges ── */
.badge { font-size: 0.72rem; font-weight: 600; padding: .26em .56em; border-radius: 5px; letter-spacing: .02em; }
.status-badge {
  display: inline-block; padding: .24rem .65rem; border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: .02em;
}

/* ── Alerts ── */
.alert { font-size: 0.875rem; border-radius: var(--radius-md); border: none !important; padding: 12px 16px; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-danger   { background: #fef2f2; color: #991b1b; }
.alert-warning  { background: #fffbeb; color: #92400e; }
.alert-info     { background: #eff6ff; color: #1e40af; }

/* ── Audit action badges ── */
.at-action-badge {
  display: inline-block; padding: .18rem .46rem; border-radius: 4px;
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; white-space: nowrap; flex-shrink: 0;
}
.at-action-login, .at-action-create { background: #dcfce7; color: #15803d; }
.at-action-update  { background: #dbeafe; color: #1d4ed8; }
.at-action-checkout{ background: #fef9c3; color: #a16207; }
.at-action-checkin { background: #dcfce7; color: #15803d; }
.at-action-delete  { background: #fee2e2; color: #b91c1c; }
.at-action-logout  { background: #f3f4f6; color: #374151; }

/* ── Monospace ── */
.font-monospace { font-family: 'DM Mono','Courier New',monospace !important; font-size: 0.875rem; }

/* ── Avatar ── */
.at-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg,#3b82f6,#7c3aed);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 600; flex-shrink: 0;
}

/* ── Pagination ── */
.pagination { gap: 2px; }
.page-link {
  border: 1px solid var(--border) !important; color: var(--text-secondary) !important;
  border-radius: 6px !important; font-size: 0.8125rem; padding: .32rem .65rem !important; transition: all .15s;
}
.page-link:hover { background: var(--accent-light) !important; color: var(--accent) !important; border-color: var(--accent) !important; }
.page-item.active .page-link { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.page-item.disabled .page-link { opacity: .4; }

/* ── Nav tabs ── */
.nav-tabs { border-bottom: 1px solid var(--border); gap: 2px; }
.nav-tabs .nav-link {
  font-size: 0.875rem; font-weight: 500; color: var(--text-muted);
  border: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: .5rem 1.1rem; transition: color .15s, background .15s;
}
.nav-tabs .nav-link:hover { color: var(--text-primary); background: var(--bg-card-alt); }
.nav-tabs .nav-link.active { color: var(--accent); background: var(--bg-card); border-bottom: 2px solid var(--accent); font-weight: 600; }

/* ── List groups ── */
.list-group-item { border-color: var(--border) !important; font-size: 0.875rem; }
.list-group-flush .list-group-item:last-child { border-bottom: none !important; }

/* ── Modals ── */
.modal-content { border: 1px solid var(--border) !important; border-radius: var(--radius-xl) !important; box-shadow: var(--shadow-lg) !important; }
.modal-header { border-bottom: 1px solid var(--border) !important; padding: 18px 22px !important; }
.modal-title { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.modal-footer { border-top: 1px solid var(--border) !important; padding: 14px 22px !important; }
.modal-body { padding: 20px 22px !important; }

/* ── Dropdowns ── */
.dropdown-menu { border: 1px solid var(--border) !important; border-radius: var(--radius-md) !important; box-shadow: var(--shadow-md) !important; font-size: 0.875rem; padding: 5px !important; }
.dropdown-item { border-radius: 6px; padding: .46rem .78rem !important; color: var(--text-primary) !important; transition: background .12s; }
.dropdown-item:hover { background: var(--accent-light) !important; color: var(--accent) !important; }
.dropdown-header { font-size: 0.69rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted) !important; padding: .44rem .78rem !important; }
.dropdown-divider { border-color: var(--border) !important; margin: 4px 0 !important; }

/* ── Progress ── */
.progress { height: 5px; border-radius: 99px; background: #e5e9f0; }
.progress-bar { border-radius: 99px; }

/* ── Footer ── */
.at-footer {
  font-size: 0.78rem; color: var(--text-muted);
  padding: 11px 30px; border-top: 1px solid var(--border);
  background: var(--bg-card); text-align: right;
}

/* ── DataTable search bar ── */
.card-header form .input-group { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.card-header form .input-group-text { border: none; background: var(--bg-card-alt); }
.card-header form .form-control { border: none; box-shadow: none !important; font-size: 0.875rem; }
.card-header form .btn { border: none; border-left: 1px solid var(--border); border-radius: 0; font-size: 0.875rem; }

/* ── Table inside card border radius ── */
.card > .table-responsive { border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }

/* ── Sortable headers ── */
.table thead a { text-decoration: none !important; color: inherit !important; }
.table thead a:hover { color: var(--accent) !important; }

/* ── Clickable rows ── */
tr[data-href] { cursor: pointer; }

/* ── Responsive ── */
@media (max-width: 992px) {
  .at-sidebar { transform: translateX(-100%); }
  .at-sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .at-main-wrap { margin-left: 0; }
  .at-sidebar-toggle { display: flex; }
  .at-overlay.open { display: block; }
  .at-content { padding: 18px 16px; }
}

/* ── Print ── */
@media print {
  .at-sidebar, .at-sidebar-toggle, .at-footer, .btn, .pagination { display: none !important; }
  .at-main-wrap { margin-left: 0; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: #fff; }
}
