/* BorrowEase - Main Stylesheet
   Cross-browser compatible | Fully responsive | Mobile-first
   Supports: Chrome 60+, Firefox 60+, Safari 12+, Edge 80+, iOS Safari 12+
*/
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --navy:       #1a2744;
  --navy-dark:  #111b35;
  --navy-light: #243258;
  --gold:       #c9a84c;
  --gold-light: #e2c06e;
  --white:      #ffffff;
  --bg:         #f4f5f7;
  --bg2:        #eceef2;
  --text:       #1a2744;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --success:    #10b981;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --info:       #3b82f6;
  --border:     #e5e7eb;
  --sidebar-w:  220px;
  --radius:     12px;
  --shadow:     0 2px 12px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 24px rgba(0,0,0,0.10);
}

*, *::before, *::after {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  margin: 0; padding: 0;
}

html {
  overflow-x: hidden;
  max-width: 100%;
  -webkit-text-size-adjust: 100%;
      -ms-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a, button, [role="button"] { -webkit-tap-highlight-color: transparent; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ===== LAYOUT SHELL ===== */
.app-wrap {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  min-height: 100vh; overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
      -ms-flex-direction: column; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 150;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-transition: -webkit-transform .28s cubic-bezier(.4,0,.2,1);
          transition: transform .28s cubic-bezier(.4,0,.2,1);
}

.sidebar-header {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  -ms-flex-negative: 0; flex-shrink: 0;
}

.sidebar-brand {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 10px;
}

.sidebar-logo {
  width: 36px; height: 36px;
  background: var(--gold); border-radius: 8px;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  font-size: 18px; -ms-flex-negative: 0; flex-shrink: 0;
}

.sidebar-brand-text h2 { font-size: 14px; font-weight: 700; color: white; line-height: 1.2; }
.sidebar-brand-text p  { font-size: 10px; color: rgba(255,255,255,.5); line-height: 1.3; }

.sidebar-role {
  margin: 12px 0 0;
  background: rgba(255,255,255,.07); border-radius: 8px; padding: 8px 12px;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 8px;
}

.sidebar-role-icon {
  width: 28px; height: 28px;
  background: rgba(255,255,255,.1); border-radius: 6px;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  font-size: 14px;
}

.sidebar-role-text { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.9); }

.sidebar-nav {
  -webkit-box-flex: 1; -ms-flex: 1; flex: 1;
  padding: 20px 0 12px; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.sidebar-section { padding: 0 12px; margin-bottom: 4px; }

.sidebar-section-label {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,.35);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 0 8px; margin: 12px 0 4px;
}

.nav-item {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: rgba(255,255,255,.65); font-size: 13.5px; font-weight: 500;
  -webkit-transition: all .15s; transition: all .15s;
  cursor: pointer; margin-bottom: 2px;
  touch-action: manipulation; min-height: 44px;
}
.nav-item:hover  { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: rgba(255,255,255,.12); color: white; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; -ms-flex-negative: 0; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px; border-top: 1px solid rgba(255,255,255,.07);
  -ms-flex-negative: 0; flex-shrink: 0;
}

.sidebar-user {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}

.sidebar-avatar {
  width: 34px; height: 34px; background: var(--gold); border-radius: 50%;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--navy); -ms-flex-negative: 0; flex-shrink: 0;
}

.sidebar-user-info { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: rgba(255,255,255,.4); }

.sidebar-logout {
  width: 28px; height: 28px;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  color: rgba(255,255,255,.4); border-radius: 6px;
  -webkit-transition: all .15s; transition: all .15s; -ms-flex-negative: 0; flex-shrink: 0;
}
.sidebar-logout:hover { background: rgba(255,255,255,.1); color: white; }

/* ===== OVERLAY / BACKDROP ===== */
.sidebar-backdrop, .sidebar-overlay {
  display: none; position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.45); z-index: 99; cursor: pointer;
}
.sidebar-backdrop.active, .sidebar-overlay.show { display: block; }

/* ===== HAMBURGER ===== */
.hamburger {
  display: none; position: fixed; top: 10px; left: 10px; z-index: 200;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--navy); color: white; border: none; cursor: pointer;
  font-size: 20px;
  -webkit-box-shadow: 0 4px 14px rgba(26,39,68,.35);
          box-shadow: 0 4px 14px rgba(26,39,68,.35);
  -webkit-transition: all .2s; transition: all .2s;
  touch-action: manipulation;
}
.hamburger:hover { background: var(--navy-light); }
body.sidebar-open .hamburger { opacity: 0; pointer-events: none; }

/* ===== SIDEBAR CLOSE ===== */
.sidebar-close {
  display: none; position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; background: rgba(255,255,255,.1);
  border: none; border-radius: 8px; color: rgba(255,255,255,.8);
  font-size: 18px; cursor: pointer;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  touch-action: manipulation; line-height: 1;
}
.sidebar-close:hover { background: rgba(255,255,255,.18); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  -webkit-box-flex: 1; -ms-flex: 1; flex: 1;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal;
      -ms-flex-direction: column; flex-direction: column;
  min-height: 100vh; min-width: 0; overflow-x: hidden;
}

/* ===== TOPBAR ===== */
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 0 28px; min-height: 60px;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 16px; position: -webkit-sticky; position: sticky; top: 0; z-index: 50;
  -ms-flex-negative: 0; flex-shrink: 0;
}

.topbar-breadcrumb { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 0; overflow: hidden; }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-sub   { font-size: 12px; color: var(--text-muted); }

.topbar-actions {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 10px; -ms-flex-negative: 0; flex-shrink: 0;
}

.topbar-search-wrap { display: -webkit-box; display: -ms-flexbox; display: flex; }

.search-bar {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  gap: 8px; background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 7px 14px;
}
.search-bar input {
  border: none; background: transparent; outline: none;
  font-family: inherit; font-size: 13px; color: var(--text); width: 180px;
}
.search-bar input::-webkit-input-placeholder { color: var(--text-muted); }
.search-bar input::-moz-placeholder { color: var(--text-muted); opacity: 1; }
.search-bar input:-ms-input-placeholder { color: var(--text-muted); }
.search-bar input::placeholder { color: var(--text-muted); }

.notif-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--border);
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  cursor: pointer; font-size: 16px; text-decoration: none; color: var(--text);
  -webkit-transition: all .15s; transition: all .15s; -ms-flex-negative: 0; flex-shrink: 0;
}
.notif-btn:hover { border-color: var(--navy); }

.notif-badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; background: var(--danger); border-radius: 10px;
  font-size: 9px; font-weight: 700; color: white; padding: 0 3px;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  border: 2px solid white;
}

.topbar-avatar {
  width: 38px; height: 38px; background: var(--navy); border-radius: 50%;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: white; cursor: pointer;
  -ms-flex-negative: 0; flex-shrink: 0;
}

/* ===== PAGE CONTENT ===== */
.page-content { padding: 24px 28px; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; overflow-x: hidden; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: -ms-grid; display: grid;
  grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: white; border-radius: var(--radius); padding: 18px 16px;
  -webkit-box-shadow: var(--shadow); box-shadow: var(--shadow);
  border: 1px solid var(--border); overflow: hidden; min-width: 0;
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  font-size: 20px; margin-bottom: 10px;
}
.stat-icon.yellow { background: #fef9ee; }
.stat-icon.green  { background: #ecfdf5; }
.stat-icon.orange { background: #fff7ed; }
.stat-icon.blue   { background: #eff6ff; }
.stat-number { font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-label  { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-badge  { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; display: inline-block; white-space: nowrap; }
.badge-red    { background: #fef2f2; color: var(--danger); }
.badge-green  { background: #ecfdf5; color: var(--success); }
.badge-blue   { background: #eff6ff; color: var(--info); }
.badge-yellow { background: #fffbeb; color: var(--warning); }
.badge-gray   { background: var(--bg2); color: var(--text-muted); }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: -ms-grid; display: grid;
  grid-template-columns: 1fr 340px; gap: 20px;
}

/* ===== CARDS ===== */
.card { background: white; border-radius: var(--radius); -webkit-box-shadow: var(--shadow); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
.card-header {
  padding: 14px 20px; background: var(--navy); color: white;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
  -ms-flex-wrap: wrap; flex-wrap: wrap; gap: 8px;
}
.card-title { font-size: 14px; font-weight: 700; }
.card-sub   { font-size: 11px; color: rgba(255,255,255,.6); }
.card-body  { padding: 0; }

/* ===== ACTIVITY ===== */
.activity-item {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: flex-start; -ms-flex-align: flex-start; align-items: flex-start;
  gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--bg);
  -webkit-transition: background .15s; transition: background .15s;
}
.activity-item:hover { background: #fafbfc; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 32px; height: 32px; border-radius: 8px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; font-size: 14px; -ms-flex-negative: 0; flex-shrink: 0; margin-top: 2px; }
.dot-green  { background: #ecfdf5; }
.dot-blue   { background: #eff6ff; }
.dot-yellow { background: #fffbeb; }
.dot-red    { background: #fef2f2; }
.activity-info  { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 0; }
.activity-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-desc  { font-size: 11px; color: var(--text-muted); }
.activity-time  { font-size: 11px; color: var(--text-light); white-space: nowrap; -ms-flex-negative: 0; flex-shrink: 0; }

/* ===== CALENDAR ===== */
.calendar-wrap { padding: 16px; }
.calendar-nav {
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
  margin-bottom: 12px;
}
.calendar-nav button { background: none; border: none; cursor: pointer; padding: 6px 10px; border-radius: 6px; font-size: 14px; color: var(--text-muted); min-width: 36px; min-height: 36px; touch-action: manipulation; }
.calendar-nav button:hover { background: var(--bg); }
.calendar-grid { display: -ms-grid; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day-header { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.cal-day { text-align: center; font-size: 12px; padding: 7px 2px; border-radius: 6px; cursor: pointer; -webkit-transition: all .15s; transition: all .15s; color: var(--text); touch-action: manipulation; min-height: 28px; }
.cal-day:hover       { background: var(--bg); }
.cal-day.other-month { color: var(--text-light); }
.cal-day.today       { background: var(--navy); color: white; font-weight: 700; }
.cal-day.has-event   { background: var(--gold-light); color: var(--navy); font-weight: 600; }
.calendar-legend { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--bg2); font-size: 11px; color: var(--text-muted); -ms-flex-wrap: wrap; flex-wrap: wrap; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* ===== QUICK ACTIONS ===== */
.quick-actions { margin-top: 20px; }
.quick-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.quick-grid { display: -ms-grid; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.quick-card { background: white; border-radius: var(--radius); padding: 18px; border: 1px solid var(--border); cursor: pointer; -webkit-transition: all .2s; transition: all .2s; text-decoration: none; color: inherit; display: block; }
.quick-card:hover { border-color: var(--navy); -webkit-box-shadow: var(--shadow-md); box-shadow: var(--shadow-md); -webkit-transform: translateY(-2px); -ms-transform: translateY(-2px); transform: translateY(-2px); }
.quick-icon { width: 36px; height: 36px; border-radius: 8px; background: #ecfdf5; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; font-size: 18px; margin-bottom: 10px; }
.quick-card-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.quick-card-desc  { font-size: 11px; color: var(--text-muted); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 520px; }
thead th { padding: 10px 16px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; background: var(--bg); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
tbody td  { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--bg2); color: var(--text); vertical-align: middle; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: none; }
.status-pill { display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill-pending   { background: #fffbeb; color: var(--warning); }
.pill-approved  { background: #ecfdf5; color: var(--success); }
.pill-rejected  { background: #fef2f2; color: var(--danger); }
.pill-completed { background: #eff6ff; color: var(--info); }
.pill-cancelled { background: var(--bg2); color: var(--text-muted); }

/* ===== BUTTONS ===== */
.btn { display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: none; -webkit-transition: all .2s; transition: all .2s; touch-action: manipulation; min-height: 36px; white-space: nowrap; line-height: 1.2; }
.btn-sm { padding: 5px 12px; font-size: 12px; min-height: 30px; }
.btn-navy    { background: var(--navy); color: white; }
.btn-navy:hover { background: var(--navy-light); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: .9; }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover  { opacity: .9; }
.btn-gold    { background: var(--gold); color: white; }
.btn-gold:hover    { opacity: .9; }
.btn-ghost   { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

/* ===== FORMS ===== */
.form-card { background: white; border-radius: var(--radius); border: 1px solid var(--border); padding: 24px; margin-bottom: 20px; }
.form-card-title { font-size: 15px; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--bg2); }
.form-row { display: -ms-grid; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group, .form-group-inner { margin-bottom: 16px; }
.form-group label, .form-group-inner label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.form-label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }

.form-select, .form-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 14px; color: var(--text);
  background: #fafafa; outline: none;
  -webkit-transition: border-color .2s, -webkit-box-shadow .2s; transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
select.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-select:focus, .form-input:focus {
  border-color: var(--navy);
  -webkit-box-shadow: 0 0 0 3px rgba(26,39,68,.08); box-shadow: 0 0 0 3px rgba(26,39,68,.08);
  background: white;
}
textarea.form-input { resize: vertical; min-height: 80px; }

.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute; left: 14px; top: 50%;
  -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); transform: translateY(-50%);
  color: var(--text-muted); font-size: 15px; pointer-events: none; z-index: 1;
}
.form-control {
  width: 100%; padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 14px; color: var(--text); background: #fafafa;
  -webkit-transition: border-color .2s, -webkit-box-shadow .2s; transition: border-color .2s, box-shadow .2s;
  outline: none; -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.form-control:focus { border-color: var(--navy); -webkit-box-shadow: 0 0 0 3px rgba(26,39,68,.08); box-shadow: 0 0 0 3px rgba(26,39,68,.08); background: white; }
.form-control.no-icon { padding-left: 14px; }
.input-wrap.has-eye .form-control { padding-right: 46px; }
.input-wrap .eye-btn {
  position: absolute; right: 0; top: 0; bottom: 0; width: 46px;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: var(--text-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  -webkit-transition: color .18s, background .18s; transition: color .18s, background .18s;
  padding: 0; -ms-flex-negative: 0; flex-shrink: 0; touch-action: manipulation;
}
.input-wrap .eye-btn:hover, .input-wrap .eye-btn:focus { color: var(--navy); background: rgba(26,39,68,.05); outline: none; }
.input-wrap .eye-btn.active { color: var(--navy); }
.eye-icon { width: 18px; height: 18px; }

/* Login buttons */
.btn-primary {
  display: block; width: 100%; padding: 14px;
  background: var(--navy); color: white; border: none; border-radius: var(--radius);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  -webkit-transition: background .2s, -webkit-transform .1s; transition: background .2s, transform .1s;
  text-align: center; touch-action: manipulation; min-height: 48px;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.btn-primary:hover  { background: var(--navy-light); }
.btn-primary:active { -webkit-transform: scale(.98); -ms-transform: scale(.98); transform: scale(.98); }

.btn-outline {
  display: block; width: 100%; padding: 13px;
  background: white; color: var(--text); border: 1.5px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  -webkit-transition: all .2s; transition: all .2s;
  text-align: center; touch-action: manipulation; min-height: 48px;
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }

.divider { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-muted); font-size: 12px; }
.divider::before, .divider::after { content: ''; -webkit-box-flex: 1; -ms-flex: 1; flex: 1; height: 1px; background: var(--border); }
.forgot-link { display: block; text-align: center; margin-top: 14px; color: var(--text-muted); font-size: 13px; }
.forgot-link:hover { color: var(--navy); }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 8px; -ms-flex-wrap: wrap; flex-wrap: wrap; }
.alert-danger  { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.5); z-index: 1000;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  padding: 16px; opacity: 0; pointer-events: none;
  -webkit-transition: opacity .2s; transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white; border-radius: 16px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  -webkit-transform: scale(.95) translateY(10px); -ms-transform: scale(.95) translateY(10px); transform: scale(.95) translateY(10px);
  -webkit-transition: -webkit-transform .2s; transition: transform .2s;
}
.modal-overlay.open .modal { -webkit-transform: scale(1) translateY(0); -ms-transform: scale(1) translateY(0); transform: scale(1) translateY(0); }
.modal-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; gap: 12px; }
.modal-title  { font-size: 16px; font-weight: 700; }
.modal-close  { width: 32px; height: 32px; border-radius: 8px; background: var(--bg); border: none; cursor: pointer; font-size: 16px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -ms-flex-negative: 0; flex-shrink: 0; touch-action: manipulation; }
.modal-close:hover { background: var(--bg2); }
.modal-body   { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: -webkit-box; display: -ms-flexbox; display: flex; gap: 10px; -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; -ms-flex-wrap: wrap; flex-wrap: wrap; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state-icon  { font-size: 48px; margin-bottom: 12px; }
.empty-state-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.empty-state-desc  { font-size: 13px; }

/* ===== INVENTORY GRID ===== */
.inventory-grid { display: -ms-grid; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.inv-card { background: white; border-radius: var(--radius); border: 1px solid var(--border); padding: 18px; -webkit-transition: all .2s; transition: all .2s; position: relative; overflow: hidden; }
.inv-card:hover { -webkit-box-shadow: var(--shadow-md); box-shadow: var(--shadow-md); -webkit-transform: translateY(-2px); -ms-transform: translateY(-2px); transform: translateY(-2px); }
.inv-icon { width: 44px; height: 44px; background: var(--bg2); border-radius: 10px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.inv-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; word-break: break-word; }
.inv-qty  { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.inv-fee  { font-size: 13px; font-weight: 600; color: var(--navy); }

/* ===== NOTIFICATIONS ===== */
.notif-list .notif-item { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--bg2); -webkit-transition: background .15s; transition: background .15s; -webkit-box-align: flex-start; -ms-flex-align: flex-start; align-items: flex-start; }
.notif-item:hover  { background: #fafbfc; }
.notif-item.unread { background: #f0f4ff; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; -ms-flex-negative: 0; flex-shrink: 0; }
.notif-item.unread .notif-dot     { background: var(--info); }
.notif-item:not(.unread) .notif-dot { background: transparent; }

/* ===== LOGIN PAGE ===== */
.login-wrap { display: -webkit-box; display: -ms-flexbox; display: flex; min-height: 100vh; overflow-x: hidden; }
.login-left {
  width: 360px; -ms-flex-negative: 0; flex-shrink: 0;
  background: var(--navy);
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
  -webkit-box-align: center; -ms-flex-align: center; align-items: center;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  padding: 48px 36px; color: white;
}
.login-logo { width: 80px; height: 80px; background: var(--gold); border-radius: 18px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; margin-bottom: 16px; font-size: 36px; }
.login-brand { font-size: 26px; font-weight: 700; color: white; margin-bottom: 8px; }
.login-tagline { font-size: 13px; color: rgba(255,255,255,.65); text-align: center; margin-bottom: 40px; line-height: 1.7; }
.login-features { width: 100%; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; gap: 16px; }
.login-feature { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; gap: 12px; color: rgba(255,255,255,.75); font-size: 13px; }
.login-feature-icon { width: 32px; height: 32px; background: rgba(255,255,255,.08); border-radius: 8px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; font-size: 15px; -ms-flex-negative: 0; flex-shrink: 0; }
.login-right {
  -webkit-box-flex: 1; -ms-flex: 1; flex: 1;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: flex-start; -ms-flex-align: flex-start; align-items: flex-start;
  -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
  padding: 48px 32px; background: white;
  overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 100vh;
}
.login-form-wrap { width: 100%; max-width: 460px; padding-bottom: 40px; }
.login-title    { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; }

/* ===== TOAST NOTIFICATIONS ===== */
.flash-container {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
  gap: 10px; pointer-events: none;
  max-width: 360px; width: -webkit-calc(100vw - 40px); width: calc(100vw - 40px);
}
.flash {
  background: white; border-radius: 12px; padding: 14px 16px;
  -webkit-box-shadow: 0 8px 32px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08);
          box-shadow: 0 8px 32px rgba(0,0,0,.16), 0 2px 8px rgba(0,0,0,.08);
  font-size: 13px; font-weight: 500;
  display: -webkit-box; display: -ms-flexbox; display: flex;
  -webkit-box-align: flex-start; -ms-flex-align: flex-start; align-items: flex-start;
  gap: 10px; border-left: 4px solid var(--info);
  pointer-events: all; position: relative; overflow: hidden;
  -webkit-animation: toastIn .35s cubic-bezier(.21,1.02,.73,1) forwards;
          animation: toastIn .35s cubic-bezier(.21,1.02,.73,1) forwards;
}
.flash.success { border-color: var(--success); }
.flash.error   { border-color: var(--danger); }
.flash.warning { border-color: var(--warning); }
.flash.info    { border-color: var(--info); }
.flash-icon  { font-size: 16px; -ms-flex-negative: 0; flex-shrink: 0; margin-top: 1px; }
.flash-body  { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 0; }
.flash-title { font-weight: 700; font-size: 13px; line-height: 1.3; }
.flash-msg   { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; word-break: break-word; }
.flash-close { background: none; border: none; cursor: pointer; color: var(--text-light); font-size: 18px; line-height: 1; padding: 0; -ms-flex-negative: 0; flex-shrink: 0; -ms-flex-item-align: start; align-self: flex-start; touch-action: manipulation; min-width: 24px; min-height: 24px; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; }
.flash-close:hover { color: var(--text); }
.flash-progress { position: absolute; bottom: 0; left: 0; height: 3px; background: currentColor; opacity: .25; -webkit-animation: toastProgress 5s linear forwards; animation: toastProgress 5s linear forwards; border-radius: 0 0 0 12px; }
.flash.success .flash-progress { color: var(--success); }
.flash.error   .flash-progress { color: var(--danger); }
.flash.warning .flash-progress { color: var(--warning); }
.flash.info    .flash-progress { color: var(--info); }
.flash.fade-out { -webkit-animation: toastOut .3s ease forwards; animation: toastOut .3s ease forwards; }

@-webkit-keyframes toastIn { from { opacity:0; -webkit-transform:translateX(24px) scale(.96); transform:translateX(24px) scale(.96); } to { opacity:1; -webkit-transform:translateX(0) scale(1); transform:translateX(0) scale(1); } }
@keyframes toastIn { from { opacity:0; -webkit-transform:translateX(24px) scale(.96); transform:translateX(24px) scale(.96); } to { opacity:1; -webkit-transform:translateX(0) scale(1); transform:translateX(0) scale(1); } }
@-webkit-keyframes toastOut { from { opacity:1; -webkit-transform:translateX(0); transform:translateX(0); max-height:120px; } to { opacity:0; -webkit-transform:translateX(24px); transform:translateX(24px); max-height:0; padding:0; } }
@keyframes toastOut { from { opacity:1; -webkit-transform:translateX(0); transform:translateX(0); max-height:120px; } to { opacity:0; -webkit-transform:translateX(24px); transform:translateX(24px); max-height:0; padding:0; } }
@-webkit-keyframes toastProgress { from { width:100%; } to { width:0%; } }
@keyframes toastProgress { from { width:100%; } to { width:0%; } }

/* ===== UTILITY ===== */
.flex            { display: -webkit-box; display: -ms-flexbox; display: flex; }
.items-center    { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }
.justify-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }
.gap-2           { gap: 8px; }
.gap-3           { gap: 12px; }
.mb-4            { margin-bottom: 16px; }
.mb-6            { margin-bottom: 24px; }
.text-sm         { font-size: 12px; }
.text-muted      { color: var(--text-muted); }
.font-bold       { font-weight: 700; }
.w-full          { width: 100%; }
.flex-wrap       { -ms-flex-wrap: wrap; flex-wrap: wrap; }

.page-action-bar { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -ms-flex-wrap: wrap; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* ===== CARD-TABLE (mobile) ===== */
.table-responsive-cards thead { display: none; }
.table-responsive-cards tbody tr { display: block; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; background: white; -webkit-box-shadow: var(--shadow); box-shadow: var(--shadow); overflow: hidden; }
.table-responsive-cards tbody td { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; -webkit-box-align: center; -ms-flex-align: center; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--bg2); font-size: 13px; gap: 8px; }
.table-responsive-cards tbody td:last-child { border-bottom: none; }
.table-responsive-cards tbody td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; -ms-flex-negative: 0; flex-shrink: 0; min-width: 90px; }

/* ============================================================
   DESKTOP (1101px+)
   ============================================================ */
@media (min-width: 1101px) {
  .sidebar { -webkit-transform: translateX(0) !important; transform: translateX(0) !important; }
}

/* ============================================================
   TABLET (769px – 1100px)
   ============================================================ */
@media (max-width: 1100px) {
  :root { --sidebar-w: 200px; }
  .stats-grid      { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid  { grid-template-columns: 1fr; }
  .quick-grid      { grid-template-columns: repeat(2, 1fr); }
  .topbar          { padding: 0 20px; }
  .page-content    { padding: 20px; }
  .search-bar input { width: 140px; }
  .profile-layout  { grid-template-columns: 1fr !important; }
}

/* ============================================================
   MOBILE (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
  .hamburger    { display: -webkit-box; display: -ms-flexbox; display: flex; }
  .sidebar-close { display: -webkit-box; display: -ms-flexbox; display: flex; }

  .sidebar { -webkit-transform: translateX(-280px); -ms-transform: translateX(-280px); transform: translateX(-280px); width: 260px !important; z-index: 200; }
  .sidebar.open { -webkit-transform: translateX(0); -ms-transform: translateX(0); transform: translateX(0); -webkit-box-shadow: 4px 0 24px rgba(0,0,0,.25); box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  .sidebar-header { padding-top: 56px; }

  .main-content { margin-left: 0 !important; }

  .topbar { padding: 8px 12px 8px 62px; min-height: 54px; height: auto; }
  .topbar-title    { font-size: 15px; }
  .topbar-sub      { display: none; }
  .topbar-search-wrap { display: none; }

  .page-content { padding: 14px 12px; }

  .stats-grid  { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stat-card   { padding: 12px 10px; }
  .stat-number { font-size: 22px; }
  .stat-icon   { width: 34px; height: 34px; font-size: 16px; margin-bottom: 8px; }
  .stat-label  { font-size: 11px; }
  .stat-badge  { font-size: 10px; padding: 1px 6px; }

  .dashboard-grid { grid-template-columns: 1fr; gap: 14px; }
  .quick-grid     { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .quick-card     { padding: 14px; }

  .card         { border-radius: 10px; }
  .card-header  { padding: 12px 14px; }
  .activity-item { padding: 12px 14px; }

  .btn    { padding: 8px 14px; font-size: 13px; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }

  .form-row  { grid-template-columns: 1fr !important; gap: 0; }
  .form-card { padding: 16px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 480px; }

  .inventory-grid { grid-template-columns: repeat(2, 1fr); }

  .modal-overlay { padding: 0; -webkit-box-align: end; -ms-flex-align: end; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 92vh; max-width: 100% !important; width: 100%; }
  .modal-header  { padding: 14px 16px; }
  .modal-title   { font-size: 15px; }
  .modal-body    { padding: 14px 16px; }
  .modal-footer  { padding: 12px 16px; }
  .modal-footer .btn { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; min-width: 0; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; }

  .login-left { display: none; }
  .login-right { padding: 28px 20px; -webkit-box-align: center; -ms-flex-align: center; align-items: center; min-height: 100vh; }
  .login-form-wrap { max-width: 100%; }

  .alert { font-size: 13px; padding: 10px 12px; }
  .empty-state { padding: 36px 16px; }
  .empty-state-icon { font-size: 38px; }

  .flash-container { top: auto; bottom: 14px; right: 10px; left: 10px; width: auto; max-width: none; }
  @-webkit-keyframes toastIn { from { opacity:0; -webkit-transform:translateY(16px) scale(.96); transform:translateY(16px) scale(.96); } to { opacity:1; -webkit-transform:translateY(0) scale(1); transform:translateY(0) scale(1); } }
  @keyframes toastIn { from { opacity:0; -webkit-transform:translateY(16px) scale(.96); transform:translateY(16px) scale(.96); } to { opacity:1; -webkit-transform:translateY(0) scale(1); transform:translateY(0) scale(1); } }
  @-webkit-keyframes toastOut { from { opacity:1; -webkit-transform:translateY(0); transform:translateY(0); max-height:120px; } to { opacity:0; -webkit-transform:translateY(16px); transform:translateY(16px); max-height:0; padding:0; } }
  @keyframes toastOut { from { opacity:1; -webkit-transform:translateY(0); transform:translateY(0); max-height:120px; } to { opacity:0; -webkit-transform:translateY(16px); transform:translateY(16px); max-height:0; padding:0; } }

  .page-action-bar .btn { font-size: 12px; padding: 7px 12px; }
  .profile-layout { grid-template-columns: 1fr !important; }
}

/* ============================================================
   SMALL PHONES (max-width: 480px)
   ============================================================ */
@media (max-width: 480px) {
  .topbar { padding: 8px 8px 8px 58px; min-height: 52px; }
  .topbar-title { font-size: 14px; }
  .page-content { padding: 10px 8px; }

  .stats-grid  { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card   { padding: 10px 8px; }
  .stat-number { font-size: 20px; }
  .stat-icon   { width: 30px; height: 30px; font-size: 14px; margin-bottom: 6px; }
  .stat-label  { font-size: 10px; }
  .stat-badge  { font-size: 9px; padding: 1px 5px; }

  .quick-grid     { grid-template-columns: 1fr; }
  .inventory-grid { grid-template-columns: 1fr; }

  .btn-primary, .btn-outline { font-size: 14px; padding: 13px; }
  .form-card       { padding: 14px; }
  .form-card-title { font-size: 14px; }

  .login-right    { padding: 24px 14px; }
  .login-title    { font-size: 22px; }
  .login-subtitle { font-size: 13px; margin-bottom: 18px; }

  .modal-header { padding: 14px; }
  .modal-body   { padding: 12px 14px; }
  .modal-footer { padding: 10px 14px; }
  .modal-footer .btn { font-size: 12px; }

  .table-responsive-cards tbody td { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; }
  .table-responsive-cards tbody td::before { min-width: unset; margin-bottom: 2px; }
}

/* ============================================================
   EXTRA SMALL (max-width: 360px)
   ============================================================ */
@media (max-width: 360px) {
  .topbar { padding: 8px 8px 8px 52px; }
  .stats-grid  { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card   { padding: 8px 6px; }
  .stat-number { font-size: 17px; }
  .quick-grid  { grid-template-columns: 1fr; }
  .topbar-avatar { display: none; }
  .hamburger   { width: 40px; height: 40px; top: 8px; left: 8px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .sidebar, .topbar, .hamburger, .sidebar-overlay, .sidebar-backdrop,
  .flash-container, .btn, .notif-btn { display: none !important; }
  .main-content  { margin-left: 0 !important; }
  .page-content  { padding: 0 !important; }
  .stats-grid    { grid-template-columns: repeat(4,1fr) !important; }
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .card          { -webkit-box-shadow: none; box-shadow: none; border: 1px solid #ddd; }
  * { -webkit-print-color-adjust: exact; color-adjust: exact; }
}

/* ============================================================
   COMPREHENSIVE MOBILE RESPONSIVE ENHANCEMENTS
   Enhanced for all phones: iPhone SE to large Android
   ============================================================ */

/* ── Safe area insets for notched phones (iPhone X+) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  .sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .topbar {
    padding-top: max(0px, env(safe-area-inset-top));
  }
  .flash-container {
    bottom: max(14px, env(safe-area-inset-bottom));
  }
  .modal {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ── Global touch improvements ── */
* {
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
input, select, textarea, button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* ── Topbar: better mobile spacing ── */
@media (max-width: 768px) {
  .topbar-actions {
    gap: 6px;
  }
  .notif-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }
  .topbar-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }
}

/* ── Page action bar: stack on mobile ── */
@media (max-width: 600px) {
  .page-action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .page-action-bar > * {
    width: 100%;
    justify-content: center;
  }
  .page-action-bar .flex,
  .page-action-bar > div[style*="flex"] {
    flex-wrap: wrap;
    gap: 6px;
  }
  .page-action-bar .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }
}

/* ── Stat cards: single column on very small ── */
@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
}

/* ── Quick grid: full-width on small phones ── */
@media (max-width: 400px) {
  .quick-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ── Inventory grid: responsive breakpoints ── */
@media (max-width: 600px) {
  .inventory-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
@media (max-width: 380px) {
  .inventory-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Tables: horizontal scroll with visual hint ── */
.table-wrap {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
  -ms-scroll-chaining: none;
  overscroll-behavior-x: contain;
}
@media (max-width: 768px) {
  .table-wrap::after {
    content: '';
    display: block;
    height: 1px;
  }
  table {
    min-width: 500px;
  }
  thead th, tbody td {
    padding: 10px 12px;
    white-space: nowrap;
  }
}

/* ── Card hover states: disable on touch ── */
@media (hover: none) {
  .quick-card:hover,
  .inv-card:hover {
    -webkit-transform: none;
    transform: none;
    box-shadow: var(--shadow);
  }
}

/* ── Forms: larger touch targets on mobile ── */
@media (max-width: 768px) {
  .form-select,
  .form-input,
  .form-control {
    font-size: 16px; /* Prevent iOS zoom on focus */
    padding: 12px 14px;
    min-height: 48px;
  }
  select.form-select,
  select.form-control {
    padding-right: 36px;
  }
  .form-control.no-icon {
    padding-left: 14px;
  }
  .input-wrap .input-icon {
    font-size: 16px;
  }
  .form-group {
    margin-bottom: 14px;
  }
  .form-label {
    font-size: 14px;
  }
}

/* ── Form rows: single column on mobile ── */
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0;
  }
  .reg-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* ── Modals: full screen on small phones ── */
@media (max-width: 480px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
    max-width: 100% !important;
    width: 100%;
  }
}
@media (max-width: 360px) {
  .modal-header { padding: 12px 14px; }
  .modal-body   { padding: 10px 14px; }
  .modal-footer { padding: 10px 14px; gap: 8px; }
  .modal-footer .btn { flex: 1; font-size: 12px; }
}

/* ── Login page: mobile improvements ── */
@media (max-width: 768px) {
  .login-wrap {
    flex-direction: column;
  }
  .login-left {
    display: none;
  }
  .login-right {
    flex: 1;
    width: 100%;
    padding: 28px 16px;
    min-height: 100vh;
    align-items: center;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .login-form-wrap {
    width: 100%;
    max-width: 420px;
  }
  .login-title {
    font-size: 22px;
  }
  .login-subtitle {
    font-size: 13px;
  }
  .btn-primary,
  .btn-outline {
    font-size: 15px;
    padding: 14px;
    min-height: 50px;
  }
}
@media (max-width: 400px) {
  .login-right {
    padding: 20px 12px;
  }
  .login-title {
    font-size: 20px;
  }
  .login-tabs {
    gap: 4px;
    padding: 4px;
  }
  .login-tab {
    font-size: 11px;
    padding: 8px 4px 6px;
  }
  .login-tab .tab-sub {
    display: none;
  }
  .type-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ── Sidebar: swipe-friendly on all phones ── */
@media (max-width: 768px) {
  .sidebar {
    -webkit-transform: translateX(-280px);
    transform: translateX(-280px);
    width: 270px !important;
    max-width: 85vw;
    will-change: transform;
    box-shadow: none;
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), box-shadow 0.28s;
  }
  .sidebar.open {
    -webkit-transform: translateX(0);
    transform: translateX(0);
    box-shadow: 6px 0 32px rgba(0,0,0,0.3);
  }
  .main-content {
    margin-left: 0 !important;
  }
  body.sidebar-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }
}

/* ── Sidebar nav: bigger touch targets ── */
.nav-item {
  min-height: 44px;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Hamburger: better positioning ── */
@media (max-width: 768px) {
  .hamburger {
    display: -webkit-flex;
    display: flex;
    top: 8px;
    left: 8px;
    width: 42px;
    height: 42px;
    font-size: 18px;
    z-index: 201;
  }
}

/* ── Dashboard grid: always single column on mobile ── */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
}

/* ── Card headers: wrap on small screens ── */
@media (max-width: 480px) {
  .card-header {
    padding: 12px 14px;
    gap: 6px;
  }
  .card-title {
    font-size: 13px;
  }
}

/* ── Activity items: compact on mobile ── */
@media (max-width: 480px) {
  .activity-item {
    padding: 10px 12px;
    gap: 10px;
  }
  .activity-dot {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
  .activity-title {
    font-size: 12px;
  }
  .activity-desc {
    font-size: 11px;
  }
  .activity-time {
    font-size: 10px;
  }
}

/* ── Notification items ── */
@media (max-width: 480px) {
  .notif-list .notif-item {
    padding: 12px;
    gap: 10px;
  }
}

/* ── Buttons: full-width in forms on mobile ── */
@media (max-width: 480px) {
  .btn {
    min-height: 40px;
  }
  .modal-footer .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
  }
}

/* ── Profile layout: always stacked on mobile ── */
@media (max-width: 700px) {
  .profile-layout {
    grid-template-columns: 1fr !important;
  }
}

/* ── Prevent text size adjust on all phones ── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── Better scrolling on iOS ── */
.sidebar,
.modal,
.table-wrap,
.sidebar-nav {
  -webkit-overflow-scrolling: touch;
}

/* ── Prevent double-tap zoom on buttons ── */
a, button, [role="button"],
input[type="submit"],
input[type="button"],
input[type="reset"] {
  touch-action: manipulation;
}

/* ── Fix 300ms tap delay on older browsers ── */
html {
  touch-action: manipulation;
}

/* ── Reports page topbar: mobile scroll ── */
@media (max-width: 640px) {
  .rpt-topbar {
    height: auto;
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: wrap;
    margin: -14px -12px 14px -12px !important;
  }
  .rpt-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .rpt-filter-bar > div {
    width: 100%;
  }
  .rpt-filter-bar .form-input {
    width: 100%;
  }
  .rpt-quick-btns {
    margin-left: 0;
    width: 100%;
  }
  .rpt-quick-btn {
    flex: 1;
    text-align: center;
    padding: 8px 6px;
  }
  .rpt-size-group {
    flex-wrap: wrap;
    gap: 4px;
  }
  .rpt-size-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}

/* ── Admin tabs: scroll horizontal ── */
.adm-tabs {
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}
.adm-tab {
  scroll-snap-align: start;
}
@media (max-width: 480px) {
  .adm-tab {
    font-size: 11px;
    padding: 8px 10px;
    gap: 4px;
  }
}

/* ── Approval queue: responsive fields ── */
@media (max-width: 380px) {
  .aq-fields {
    grid-template-columns: 1fr;
  }
  .aq-card {
    padding: 12px;
    gap: 10px;
  }
  .aq-card-actions .btn {
    font-size: 12px;
    padding: 8px 10px;
  }
}

/* ── Users page: responsive cards ── */
@media (max-width: 380px) {
  .usr-fields {
    grid-template-columns: 1fr;
  }
  .usr-card {
    padding: 12px;
  }
  .usr-card-actions {
    flex-direction: column;
  }
  .usr-card-actions form {
    width: 100%;
  }
  .usr-card-actions .form-select {
    width: 100%;
  }
  .usr-card-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Forgot password: responsive card ── */
.fp-outer {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 20px 12px;
  box-sizing: border-box;
}
.fp-card {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
@media (max-width: 520px) {
  .fp-outer {
    padding: 0;
    align-items: flex-end;
  }
  .fp-card {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    min-height: 85vh;
  }
}
@media (max-width: 380px) {
  .fp-outer {
    padding: 0;
  }
}

/* ── Flash toasts: bottom on mobile ── */
@media (max-width: 600px) {
  .flash-container {
    top: auto;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
  }
}

/* ── Empty states: compact on mobile ── */
@media (max-width: 480px) {
  .empty-state {
    padding: 32px 14px;
  }
  .empty-state-icon {
    font-size: 36px;
  }
  .empty-state-title {
    font-size: 14px;
  }
  .empty-state-desc {
    font-size: 12px;
  }
}

/* ── Landscape phone adjustments ── */
@media (max-height: 500px) and (orientation: landscape) {
  .sidebar {
    padding-top: 0;
  }
  .sidebar-header {
    padding-top: 12px;
  }
  .hamburger {
    top: 6px;
    left: 6px;
    width: 38px;
    height: 38px;
  }
  .topbar {
    min-height: 48px;
    padding: 6px 10px 6px 52px;
  }
  .page-content {
    padding: 10px 12px;
  }
  .login-right {
    padding: 16px;
  }
  .login-title {
    font-size: 18px;
    margin-bottom: 4px;
  }
  .login-subtitle {
    margin-bottom: 12px;
  }
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
  }
}

/* ── Pinch zoom: allow content zoom, prevent layout zoom ── */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
  .app-wrap {
    overflow-x: hidden;
  }
}

/* ── Better focus styles for accessibility ── */
:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ── Responsive typography ── */
@media (max-width: 480px) {
  .topbar-title {
    font-size: 14px;
  }
  .quick-title {
    font-size: 14px;
    margin-bottom: 10px;
  }
  .quick-card-title {
    font-size: 12px;
  }
  .quick-card-desc {
    font-size: 10px;
  }
  .inv-name {
    font-size: 13px;
  }
  .inv-qty, .inv-fee {
    font-size: 12px;
  }
}

/* ── High-DPI / Retina screen adjustments ── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .sidebar, .topbar {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ── Dark mode: respect system preference ── */
@media (prefers-color-scheme: dark) {
  /* Intentionally not forcing dark mode — keep the design consistent
     but ensure no jarring white flashes on scroll bounce */
  html {
    background-color: var(--bg);
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    -webkit-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    -webkit-transition-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print: hide mobile elements ── */
@media print {
  .hamburger, .sidebar-backdrop, .sidebar-overlay,
  .sidebar-close, .flash-container { display: none !important; }
}

/* ============================================================
   CROSS-BROWSER COMPATIBILITY ADDITIONS
   Targets: Chrome 49+, Firefox 52+, Safari 9+, Edge 14+,
            IE11, iOS Safari 9+, Samsung Internet 5+,
            UC Browser, Opera Mini, older Android WebView
   ============================================================ */

/* ── CSS Variables fallback for IE11 ── */
/* IE11 does not support CSS custom properties — we inject fallbacks */
/* IE11 detection: use a separate IE-only stylesheet loaded conditionally */

/* ── Flexbox: full vendor prefix set ── */
.app-wrap,
.sidebar, .sidebar-header, .sidebar-brand, .sidebar-role,
.sidebar-nav, .sidebar-footer, .sidebar-user, .sidebar-logout,
.topbar, .topbar-actions, .topbar-breadcrumb, .topbar-search-wrap,
.search-bar, .notif-btn, .topbar-avatar,
.stat-card, .stat-icon,
.activity-item, .activity-dot, .activity-info,
.nav-item, .nav-icon,
.calendar-nav, .calendar-grid,
.quick-actions, .quick-grid, .quick-card, .quick-icon,
.card-header,
.btn, .status-pill,
.modal-overlay, .modal, .modal-header, .modal-footer, .modal-close,
.login-wrap, .login-left, .login-features, .login-feature, .login-feature-icon,
.login-right,
.alert,
.flash, .flash-body, .flash-close,
.flash-container,
.form-select, .input-wrap,
.empty-state,
.notif-list .notif-item,
.divider,
.page-action-bar,
.sidebar-brand-text,
.inventory-grid,
.inv-card, .inv-icon {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

/* ── Grid: IE11 uses old -ms-grid syntax, use flex fallback ── */
/* Stats grid IE11 fallback */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  .stats-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: -8px;
    margin-bottom: 16px;
  }
  .stats-grid .stat-card {
    -ms-flex: 0 0 calc(25% - 16px);
        flex: 0 0 calc(25% - 16px);
    margin: 8px;
    min-width: 140px;
  }
  .dashboard-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0;
    margin: -10px;
  }
  .dashboard-grid > * {
    -ms-flex: 1 1 300px;
        flex: 1 1 300px;
    margin: 10px;
  }
  .form-row {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0;
    margin: -8px;
  }
  .form-row > * {
    -ms-flex: 1 1 200px;
        flex: 1 1 200px;
    margin: 8px;
  }
  .quick-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0;
    margin: -7px;
  }
  .quick-grid > * {
    -ms-flex: 1 1 160px;
        flex: 1 1 160px;
    margin: 7px;
  }
  .inventory-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0;
    margin: -8px;
  }
  .inventory-grid > * {
    -ms-flex: 0 0 calc(25% - 16px);
        flex: 0 0 calc(25% - 16px);
    margin: 8px;
    min-width: 180px;
  }
  /* IE11: sidebar fixed */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 220px;
    overflow-y: auto;
  }
  .main-content {
    margin-left: 220px;
  }
}

/* ── Transitions: webkit prefix ── */
.sidebar,
.nav-item,
.btn,
.quick-card,
.inv-card,
.form-select,
.form-input,
.form-control,
.flash,
.modal,
.modal-overlay,
.cal-day,
.sidebar-logout,
.notif-btn {
  -webkit-transition: all 0.2s ease;
     -moz-transition: all 0.2s ease;
      -ms-transition: all 0.2s ease;
       -o-transition: all 0.2s ease;
          transition: all 0.2s ease;
}

/* ── Border-radius: older webkit ── */
.sidebar, .sidebar-logo, .sidebar-role, .sidebar-role-icon,
.sidebar-avatar, .nav-item,
.stat-card, .stat-icon,
.card, .card-header,
.btn, .modal, .modal-close,
.form-select, .form-input, .form-control,
.status-pill, .stat-badge,
.quick-card, .quick-icon,
.inv-card, .inv-icon,
.alert, .flash,
.notif-btn, .topbar-avatar,
.search-bar, .activity-dot {
  -webkit-border-radius: inherit;
     -moz-border-radius: inherit;
          border-radius: inherit;
}

/* ── Box-shadow: older browsers ── */
.stat-card,
.card,
.flash,
.quick-card:hover,
.inv-card:hover {
  -webkit-box-shadow: var(--shadow, 0 2px 12px rgba(0,0,0,0.07));
     -moz-box-shadow: var(--shadow, 0 2px 12px rgba(0,0,0,0.07));
          box-shadow: var(--shadow, 0 2px 12px rgba(0,0,0,0.07));
}

/* ── Transform: webkit/ms prefix ── */
.quick-card:hover,
.inv-card:hover,
.btn-primary:active {
  -webkit-transform: translateY(-2px);
      -ms-transform: translateY(-2px);
          transform: translateY(-2px);
}

/* ── Calc() fallbacks ── */
.main-content {
  /* Fallback for browsers that don't support calc */
  margin-left: 220px;
  margin-left: var(--sidebar-w, 220px);
}

/* ── Placeholder cross-browser ── */
::-webkit-input-placeholder { color: #6b7280; opacity: 1; }
::-moz-placeholder           { color: #6b7280; opacity: 1; }
:-ms-input-placeholder       { color: #6b7280; opacity: 1; }
:-moz-placeholder            { color: #6b7280; opacity: 1; }
::placeholder                { color: #6b7280; opacity: 1; }

/* ── User select: older browsers ── */
.sidebar-brand-text, .stat-number, .card-title {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

/* ── Overflow scroll: webkit momentum ── */
.sidebar,
.sidebar-nav,
.table-wrap,
.modal,
.login-right {
  -webkit-overflow-scrolling: touch;
}

/* ── Appearance: full browser reset ── */
input, select, textarea, button {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}
select {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
}

/* ── Focus outline: cross-browser ── */
:focus {
  outline: 2px solid #1a2744;
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
/* IE/old Edge won't support :focus-visible, just allow all focus outlines */

/* ── Object-fit fallback ── */
img {
  max-width: 100%;
  height: auto;
}

/* ── Sticky positioning fallback ── */
.topbar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 50;
}
/* IE11 doesn't support sticky - fall back to static */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  .topbar {
    position: relative;
  }
}

/* ── Word break for long words ── */
.activity-title, .inv-name, .sidebar-user-name,
.flash-msg, .alert, .empty-state-desc {
  word-break: break-word;
  -ms-word-break: break-all;
  overflow-wrap: break-word;
  -ms-overflow-style: -ms-autohiding-scrollbar;
}

/* ── Grid gap fallback using margin for IE ── */
@supports not (gap: 1px) {
  .stats-grid { margin: -8px; }
  .stats-grid > * { margin: 8px; }
  .quick-grid { margin: -7px; }
  .quick-grid > * { margin: 7px; }
}

/* ── Button cursor ── */
button, [role="button"] {
  cursor: pointer;
}

/* ── SVG in older browsers ── */
svg {
  overflow: hidden;
  vertical-align: middle;
}

/* ── Table: IE border collapse ── */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Animation: webkit prefix ── */
@-webkit-keyframes toastIn {
  from { opacity: 0; -webkit-transform: translateX(24px) scale(0.96); transform: translateX(24px) scale(0.96); }
  to   { opacity: 1; -webkit-transform: translateX(0) scale(1); transform: translateX(0) scale(1); }
}
@-webkit-keyframes toastOut {
  from { opacity: 1; -webkit-transform: translateX(0); transform: translateX(0); }
  to   { opacity: 0; -webkit-transform: translateX(24px); transform: translateX(24px); }
}
@-webkit-keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ── Scrollbar: cross-browser ── */
.sidebar::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar { width: 4px; height: 4px; }
.sidebar::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

/* ── Color: MS Edge legacy filter fallback ── */
/* (for very old Edge without CSS custom property support) */
.stat-icon.yellow { background-color: #fef9ee; }
.stat-icon.green  { background-color: #ecfdf5; }
.stat-icon.orange { background-color: #fff7ed; }
.stat-icon.blue   { background-color: #eff6ff; }

/* ── Input type=date cross-browser fixes ── */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: #fafafa;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: #1a2744;
  width: 100%;
  min-height: 44px;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.7;
}
input[type="date"]::-webkit-inner-spin-button,
input[type="time"]::-webkit-inner-spin-button {
  display: none;
}

/* ── Checkbox/radio: cross-browser ── */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: auto;
     -moz-appearance: auto;
          appearance: auto;
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Print cross-browser ── */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
            print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}
