/* =============================================================
   Inventory Management System — style.css
   Design language aligned with localhost/course (app.css)
   ============================================================= */

/* ─── Design tokens (mirrors course/app.css) ─────────────── */
:root {
  --brand:        #1e3a8a;
  --brand-dark:   #172554;
  --brand-light:  #e0e7ff;
  --accent:       #4338ca;
  --sidebar-bg:   #14532d;
  --sidebar-text: #d1fae5;
  --sidebar-active: #166534;
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --success:      #16a34a;
  --success-bg:   #dcfce7;
  --warning:      #d97706;
  --warning-bg:   #fef3c7;
  --danger:       #dc2626;
  --danger-bg:    #fee2e2;
  --info:         #2563eb;
  --info-bg:      #dbeafe;
  --muted:        #6b7280;
  --muted-bg:     #f3f4f6;
  --header-bg:     #166534;
  --header-bg-alt: #14532d;
  --header-text:   #f0fdf4;
  --header-muted:  #bbf7d0;
  --radius:       10px;
  --shadow:       0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.06);
  --shadow-lg:    0 10px 24px rgba(15,23,42,.12);

  /* Legacy aliases kept for backward compatibility with views */
  --color-primary-green: var(--brand);
  --color-dark-green:    var(--brand-dark);
  --color-light-mint:    var(--brand-light);
  --color-gold-accent:   var(--warning);
  --color-alert-red:     var(--danger);
  --color-bg-main:       var(--surface);
  --color-bg-light:      var(--bg);
  --color-text-dark:     var(--text);
  --color-text-muted:    var(--text-muted);
  --color-border:        var(--border);
  --primary:   var(--brand);
  --secondary: var(--brand-dark);
  --light:     var(--brand-light);
  --white:     var(--surface);
  --text-dark: var(--text);
  --gray:      var(--text-muted);
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { color: var(--text); margin: 0 0 .5rem; }
h1 { font-size: 1.5rem;  font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
h4 { font-size: .95rem;  font-weight: 600; }
h5 { font-size: .9rem;   font-weight: 600; }

/* ─── App shell ─────────────────────────────────────────────── */
body.sidebar-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.sidebar-header {
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
  background: var(--header-bg);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none !important;
}

.sidebar-brand:hover { color: #fff; text-decoration: none; }

.sidebar-brand .brand-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

.sidebar-brand .brand-name,
.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: #fff;
  flex-shrink: 0;
}

/* When brand-name is used as text label */
.sidebar-brand span.brand-name {
  width: auto;
  height: auto;
  background: transparent;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  display: inline;
  flex-shrink: 1;
}

.sidebar-nav {
  padding: 1rem .75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: visible;
}

.sidebar-submenu-header {
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  padding: .5rem .75rem .25rem;
}

.nav-label { display: inline; }

/* ─── Nav links ─────────────────────────────────────────────── */
.nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .62rem .75rem;
  color: var(--sidebar-text);
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: .92rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-link i {
  width: 18px;
  height: 18px;
  font-size: .95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: .85;
  /* Reset coloured icons from old theme */
  color: inherit !important;
}

.nav-link:hover {
  background: var(--sidebar-active);
  color: #fff;
  text-decoration: none;
}

.nav-link.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-link-parent .nav-toggle-icon {
  margin-left: auto;
  font-size: .75rem;
  transition: transform .2s ease;
  opacity: .6;
}

.nav-link-parent .nav-toggle-icon.rotate {
  transform: rotate(180deg);
}

.nav-link .badge-notification {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 6px;
}

/* ─── Submenu ───────────────────────────────────────────────── */
.sidebar-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px 26px;
}

.sidebar-submenu.show { display: flex; }

.sidebar-submenu .nav-link {
  padding: .5rem .75rem;
  font-size: .87rem;
  color: rgba(209,250,229,.78);
  border-radius: 6px;
  margin-bottom: 0;
}

.sidebar-submenu .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.sidebar-submenu .nav-link.active {
  background: rgba(255,255,255,.1);
  color: #fff;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 8px 12px;
}

/* ─── Main wrapper & topbar ─────────────────────────────────── */
.main-wrapper {
  margin-left: 250px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar — greeting + search bar */
.main-wrapper > .app-topbar {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-bg-alt);
  padding: .85rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
  max-width: 100%;
  width: 100%;
  margin: 0;
}

.app-topbar .user-greeting {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.28);
  color: var(--header-text);
}

.app-topbar .user-greeting .user-name { color: #fff; }

/* ─── Content area ──────────────────────────────────────────── */
main.container {
  flex: 1;
  padding: 1.5rem;
  max-width: 100%;
  width: 100%;
  margin: 0;
}

/* Bootstrap container override inside .main-wrapper */
.main-wrapper .container {
  max-width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--header-bg-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  background: var(--header-bg);
  color: var(--header-text);
  border-radius: var(--radius) var(--radius) 0 0;
}

.card-header.bg-white,
.card-header.bg-light { background-color: var(--header-bg) !important; }
.card-header.border-bottom { border-bottom-color: var(--header-bg-alt) !important; }

.card-header h3,
.card-header h4,
.card-header h5,
.card-header .card-title,
.modal-title { font-size: .95rem; font-weight: 600; margin: 0; color: var(--header-text); }

.card-header .text-muted,
.card-header small,
.modal-header .text-muted { color: var(--header-muted) !important; }

.card-header .text-primary,
.card-header .text-success,
.card-header .text-info { color: var(--header-muted) !important; }

.card-header .btn-outline-secondary,
.card-header .btn-outline-dark,
.card-header .btn-outline-success {
  color: var(--header-text);
  border-color: rgba(255,255,255,.55);
}

.card-header .btn-outline-secondary:hover,
.card-header .btn-outline-dark:hover,
.card-header .btn-outline-success:hover {
  background: rgba(255,255,255,.16);
  border-color: #fff;
  color: #fff;
}

.card-body { padding: 1.25rem; }
.card-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: transparent;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ─── Stat cards (dashboard) ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.stat-icon.brand   { background: var(--brand-light);  color: var(--brand);   }
.stat-icon.success { background: var(--success-bg);   color: var(--success); }
.stat-icon.warning { background: var(--warning-bg);   color: var(--warning); }
.stat-icon.danger  { background: var(--danger-bg);    color: var(--danger);  }
.stat-icon.info    { background: var(--info-bg);      color: var(--info);    }
.stat-icon.muted   { background: var(--muted-bg);     color: var(--muted);   }

.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .8rem;  color: var(--text-muted); }

/* ─── Buttons (override Bootstrap) ─────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .5rem .95rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .88rem;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s;
  line-height: 1.2;
}

.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn i, .btn svg { width: 15px; height: 15px; font-size: .85rem; }

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

.btn-secondary  { background: #6b7280; color: #fff; border-color: #6b7280; }
.btn-secondary:hover { background: #4b5563; border-color: #4b5563; color: #fff; }

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

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

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

.btn-info       { background: var(--info);    color: #fff; border-color: var(--info); }
.btn-info:hover { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

.btn-outline-primary {
  background: transparent;
  border-color: var(--brand);
  color: var(--brand);
}
.btn-outline-primary:hover { background: var(--brand-light); color: var(--brand); }

.btn-outline-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline-secondary:hover { background: var(--bg); color: var(--text); }

.btn-outline-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn-outline-danger:hover { background: var(--danger-bg); }

.btn-outline-success {
  background: transparent;
  border-color: var(--success);
  color: var(--success);
}
.btn-outline-success:hover { background: var(--success-bg); }

.btn-outline-light {
  background: transparent;
  border-color: rgba(255,255,255,.35);
  color: #fff;
}
.btn-outline-light:hover { background: rgba(255,255,255,.08); color: #fff; }

.btn-sm { padding: .3rem .65rem; font-size: .8rem; border-radius: 6px; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .6rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  border: none;
}

/* Bootstrap badge class overrides */
.badge.bg-success, .badge-success { background: var(--success-bg) !important; color: var(--success) !important; }
.badge.bg-warning, .badge-warning { background: var(--warning-bg) !important; color: var(--warning) !important; }
.badge.bg-danger,  .badge-danger  { background: var(--danger-bg)  !important; color: var(--danger)  !important; }
.badge.bg-info,    .badge-info    { background: var(--info-bg)    !important; color: var(--info)    !important; }
.badge.bg-primary, .badge-brand   { background: var(--brand-light)!important; color: var(--brand)   !important; }
.badge.bg-secondary,
.badge-muted   { background: var(--muted-bg) !important; color: var(--muted) !important; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.1rem;
  font-size: .9rem;
  border: 1px solid transparent;
}

.alert-success { background: var(--success-bg); color: #14532d; border-color: #bbf7d0; }
.alert-danger,
.alert-error   { background: var(--danger-bg);  color: #7f1d1d; border-color: #fecaca; }
.alert-info    { background: var(--info-bg);    color: #1e3a8a; border-color: #bfdbfe; }
.alert-warning { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.table th, .table td {
  padding: .72rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table th {
  background: var(--header-bg);
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--header-text);
  font-weight: 600;
  white-space: nowrap;
}

.table thead th {
  background-color: var(--header-bg) !important;
  color: var(--header-text) !important;
  box-shadow: none !important;
  border-bottom-color: var(--header-bg-alt) !important;
}

.table thead th a,
.table thead th .text-dark,
.table thead th.text-dark { color: var(--header-text) !important; }

.table thead th .text-muted,
.table thead th.text-muted { color: var(--header-muted) !important; }

.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* Compact variant */
.compact-table th,
.compact-table td { padding: .45rem .55rem; }
.compact-table tbody tr { line-height: 1.2; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  margin-bottom: .35rem;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
}

.form-control,
.form-select {
  width: 100%;
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .9rem;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  appearance: auto;
  -webkit-appearance: auto;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67,56,202,.12);
}

.form-control-sm,
.form-select-sm {
  padding: .3rem .65rem;
  font-size: .82rem;
  border-radius: 6px;
}

.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--danger); }
.invalid-feedback,
.form-error { color: var(--danger); font-size: .78rem; margin-top: .3rem; display: block; }
.form-help,
.form-text { color: var(--text-muted); font-size: .78rem; margin-top: .3rem; }

textarea.form-control { min-height: 90px; resize: vertical; }

/* Input groups */
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group .btn:last-child { border-radius: 0 8px 8px 0; }
.input-group-text {
  display: flex;
  align-items: center;
  padding: .5rem .75rem;
  font-size: .88rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  color: var(--text-muted);
}
.input-group .form-control:not(:first-child) { border-radius: 0 8px 8px 0; border-left: 0; }
.input-group-sm .form-control { font-size: .82rem; padding: .3rem .65rem; }
.input-group-sm .btn { font-size: .8rem; padding: .3rem .65rem; }
.input-group-sm .input-group-text { font-size: .82rem; padding: .3rem .65rem; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: flex-end;
  gap: .35rem;
  margin-top: 1.1rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}

.pagination a,
.pagination span,
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 .6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: .85rem;
  text-decoration: none !important;
  transition: background .12s;
}

.pagination .active-page,
.page-item.active .page-link {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.pagination .disabled,
.page-item.disabled .page-link { opacity: .5; pointer-events: none; }
.pagination a:hover:not(.active-page),
.page-link:hover { background: var(--bg); }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-content {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--header-bg-alt);
  background: var(--header-bg);
  color: var(--header-text);
}

.modal-title { font-size: 1.05rem; font-weight: 600; color: var(--header-text); }
.modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); opacity: .85; }
.modal-body { padding: 1.3rem; }
.modal-footer {
  padding: 1rem 1.3rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.btn-close { color: var(--text-muted); }

/* ─── User greeting / topbar row ────────────────────────────── */
.user-greeting {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}

.user-greeting .user-name {
  color: var(--brand);
  font-weight: 700;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .3rem .5rem .3rem .3rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .8rem;
  object-fit: cover;
}

/* ─── Filters bar ────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filters-bar .form-group { margin-bottom: 0; min-width: 160px; flex: 1; }
.filters-bar .form-group.narrow { flex: 0 0 auto; min-width: 130px; }
.search-wrap { position: relative; flex: 2; }
.search-wrap i {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .85rem;
}
.search-wrap input { padding-left: 2.1rem; }

/* ─── Empty state ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; opacity: .35; margin-bottom: .6rem; display: block; }
.empty-state p { margin: 0 0 .5rem; }

/* ─── Meta / detail panel ────────────────────────────────────── */
.meta-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}
.meta-row {
  display: flex;
  justify-content: space-between;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.meta-row:last-child { border-bottom: none; }
.meta-row .label { color: var(--text-muted); }
.meta-row .value { font-weight: 600; }

/* ─── Selection / numbering list (like course selection-item) ── */
.selection-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .9rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: .7rem;
  background: #fff;
}

.selection-index {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
}

/* ─── Login / auth page ──────────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 50%, #172554 100%);
  padding: 1.5rem;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 2.2rem;
  position: relative;
  z-index: 1;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.4rem;
}

.auth-brand .brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 1.05rem;
}

.auth-brand-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.auth-brand-subtitle { font-size: .78rem; color: var(--text-muted); }
.auth-brand-copy { display: flex; flex-direction: column; gap: 2px; }

.auth-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
}

.auth-hero { margin-bottom: 1.4rem; }
.auth-hero h1 { font-size: 1.4rem; color: var(--brand); margin-bottom: .25rem; }
.auth-hero p { font-size: .88rem; color: var(--text-muted); margin: 0; }

.auth-kicker {
  display: inline-flex;
  align-items: center;
  padding: .2rem .65rem;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: .65rem;
}

.auth-body form { display: grid; gap: 14px; }
.auth-fields { display: grid; gap: 12px; }
.auth-field { position: relative; }
.auth-field label { display: block; margin-bottom: 6px; font-size: .84rem; font-weight: 600; }
.auth-input-wrap { position: relative; }

.auth-field input {
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0 42px 0 42px;
  background: #fff;
  color: var(--text);
  font-size: .92rem;
  transition: border-color .15s, box-shadow .15s;
}

.auth-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67,56,202,.12);
  outline: none;
}

.auth-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .9rem;
}

.password-toggle {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .9rem;
}

.auth-btn {
  width: 100%;
  height: 48px;
  border-radius: 10px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}

.auth-btn:hover { background: var(--brand-dark); }

.auth-message {
  display: none;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: .88rem;
}
.auth-message.active { display: block; }
.auth-message.error  { background: var(--danger-bg); color: #7f1d1d; }
.auth-message.info   { background: var(--info-bg); color: #1e3a8a; }

.auth-footer-note { font-size: .78rem; color: #94a3b8; text-align: center; margin-top: 1.4rem; }

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.12);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.contact-link:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.company-contact { display: flex; flex-wrap: wrap; gap: 8px; }

/* ─── Progress bars ──────────────────────────────────────────── */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  min-width: 90px;
}
.progress-bar { height: 100%; border-radius: 999px; background: var(--brand); }
.progress-bar.bg-success,
.progress-bar.low  { background: var(--success); }
.progress-bar.bg-warning,
.progress-bar.mid  { background: var(--warning); }
.progress-bar.bg-danger,
.progress-bar.full { background: var(--danger);  }

/* ─── Dropdown menus ─────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: .88rem;
  padding: .4rem;
  z-index: 99999 !important;
}
.dropdown-item {
  border-radius: 6px;
  padding: .45rem .75rem;
  color: var(--text);
  transition: background .12s;
}
.dropdown-item:hover { background: var(--bg); color: var(--text); }
.dropdown-item.active, .dropdown-item:active {
  background: var(--brand);
  color: #fff;
}

/* ─── Tabs (Bootstrap nav-tabs override) ─────────────────────── */
.nav-tabs {
  border-bottom: 1px solid var(--border);
  gap: .25rem;
}
.nav-tabs .nav-item { margin-bottom: -1px; }
.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  padding: .5rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  margin-bottom: 0;
}
.nav-tabs .nav-link:hover { color: var(--text); background: var(--bg); }
.nav-tabs .nav-link.active {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--border) var(--border) var(--surface);
}

/* ─── Accordion ──────────────────────────────────────────────── */
.accordion-button {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
}
.accordion-button:not(.collapsed) {
  background: var(--brand-light);
  color: var(--brand);
  box-shadow: none;
}
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius) !important; margin-bottom: .5rem; overflow: hidden; }

/* ─── Mobile sidebar toggle ──────────────────────────────────── */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--brand);
  border: none;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.mobile-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 49;
}

/* ─── Issue toggle ──────────────────────────────────────────────*/
.issue-toggle {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 700;
  border-radius: 6px;
}
.issue-toggle::before { content: '+'; font-size: 1rem; }
.issue-toggle:not(.collapsed)::before { content: '−'; }

/* ─── Ethiopian Calendar Date Picker ─────────────────────────── */
.eth-datepicker { position: relative; display: inline-block; width: 100%; }
.eth-display { cursor: pointer; background-color: #fff !important; }
.eth-display.eth-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67,56,202,.12);
}
.eth-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  margin-top: 4px;
}
.eth-dropdown-inner { padding: .75rem; }
.eth-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
}
.eth-nav-title { font-weight: 600; font-size: .9rem; color: var(--text); }
.eth-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .2rem .45rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .82rem;
}
.eth-nav-btn:hover { background: var(--bg); color: var(--text); }
.eth-calendar { width: 100%; border-collapse: collapse; text-align: center; }
.eth-calendar th {
  padding: .3rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.eth-calendar td { padding: .3rem; font-size: .82rem; }
.eth-day { cursor: pointer; border-radius: 6px; transition: background .12s; }
.eth-day:hover { background: var(--bg); }
.eth-day.eth-selected { background: var(--brand); color: #fff; font-weight: 600; }
.eth-day.eth-today { border: 1px solid var(--brand); font-weight: 600; }
.eth-day.eth-today.eth-selected { background: var(--brand); color: #fff; }
.eth-actions {
  display: flex;
  justify-content: space-between;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}
.eth-actions .btn { font-size: .78rem; padding: .2rem .5rem; }
.eth-date-display { white-space: nowrap; font-size: .88em; }

/* ─── Company settings form ──────────────────────────────────── */
.company-settings-form { max-width: 1180px; }
.company-settings-form .form-control-sm { width: 100%; max-width: none; }
.company-settings-form textarea.form-control-sm { min-height: 82px; resize: vertical; }
.company-settings-grid .form-label { margin-bottom: .3rem; font-size: .88rem; font-weight: 600; }
.company-settings-preview { max-width: 180px; max-height: 56px; object-fit: contain; }
.company-settings-favicon-preview { width: 32px; height: 32px; object-fit: contain; }

/* ─── Utilities ───────────────────────────────────────────────── */
.flex          { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.flex-between  { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.text-muted    { color: var(--text-muted) !important; }
.text-success  { color: var(--success) !important; }
.text-danger   { color: var(--danger)  !important; }
.text-warning  { color: var(--warning) !important; }
.text-info     { color: var(--info)    !important; }
.text-brand    { color: var(--brand)   !important; }
.text-small,
.small         { font-size: .8rem; }
.font-semibold { font-weight: 600; }
.mono          { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ─── Print ───────────────────────────────────────────────────── */
@media print {
  .sidebar, .mobile-menu-toggle,
  .main-wrapper > .app-topbar { display: none !important; }
  .main-wrapper { margin-left: 0; }
  main.container { padding: 0; }
  .card { border: none; box-shadow: none; }
  body { background: #fff !important; }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .main-wrapper { margin-left: 220px; }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 250px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .main-wrapper { margin-left: 0; }
  .mobile-menu-toggle { display: inline-flex; }
  .mobile-sidebar-backdrop { display: none; }
  .mobile-sidebar-backdrop.show { display: block; }
}

@media (max-width: 576px) {
  main.container,
  .main-wrapper .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .card-body { padding: 1rem; }
  .card-header { padding: .85rem 1rem; }
}
