/* ── IronRock Inventory — Design System ──────────────────────────────────────── */

:root {
  --ir-navy:         #1a2c4e;
  --ir-navy-mid:     #243d6b;
  --ir-navy-hover:   #2d4d85;
  --ir-navy-light:   #e8edf5;
  --ir-orange:       #e85a1e;
  --ir-orange-light: #fef1ec;
  --ir-bg:           #f0f3f8;
  --ir-card-bg:      #ffffff;
  --ir-border:       #e2e8f0;
  --ir-text:         #1e293b;
  --ir-text-muted:   #64748b;
  --ir-shadow-xs:    0 1px 2px rgba(0,0,0,0.05);
  --ir-shadow-sm:    0 1px 4px rgba(0,0,0,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --ir-shadow-md:    0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --ir-shadow-lg:    0 8px 28px rgba(0,0,0,0.10), 0 3px 8px rgba(0,0,0,0.05);
  --ir-radius:       0.75rem;
  --ir-radius-sm:    0.5rem;
}

/* ── Base ────────────────────────────────────────────────────────────────────── */

body {
  background-color: var(--ir-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Arial, sans-serif;
  font-size: 0.915rem;
  color: var(--ir-text);
  -webkit-font-smoothing: antialiased;
}

/* ── Navbar ──────────────────────────────────────────────────────────────────── */

.ir-navbar {
  background: linear-gradient(135deg, var(--ir-navy) 0%, var(--ir-navy-mid) 100%);
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}
.ir-navbar .navbar-brand {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  font-weight: 700;
}
.ir-navbar .navbar-brand i {
  color: var(--ir-orange);
}
.ir-navbar .nav-link {
  border-radius: 0.45rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.88rem;
  transition: background 0.15s ease;
  color: rgba(255,255,255,0.82) !important;
}
.ir-navbar .nav-link:hover {
  background: rgba(255,255,255,0.12);
  color: #fff !important;
}
.ir-navbar .nav-link.active {
  background: rgba(255,255,255,0.18);
  color: #fff !important;
  font-weight: 600;
}
.ir-navbar .dropdown-menu {
  border: none;
  border-radius: var(--ir-radius-sm);
  box-shadow: var(--ir-shadow-lg);
  padding: 0.4rem;
  margin-top: 0.3rem;
}
.ir-navbar .dropdown-item {
  border-radius: 0.35rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  transition: background 0.1s ease;
}
.ir-navbar .dropdown-item:hover {
  background: var(--ir-navy-light);
  color: var(--ir-navy);
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
  font-weight: 500;
  transition: all 0.15s ease;
  border-radius: 0.45rem;
}
.btn-navy {
  background-color: var(--ir-navy);
  border-color: var(--ir-navy);
  color: #fff;
}
.btn-navy:hover, .btn-navy:focus {
  background-color: var(--ir-navy-hover);
  border-color: var(--ir-navy-hover);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26,44,78,0.28);
}
.btn-outline-navy {
  color: var(--ir-navy);
  border-color: var(--ir-navy);
}
.btn-outline-navy:hover {
  background-color: var(--ir-navy);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26,44,78,0.22);
}
.btn-danger:hover  { box-shadow: 0 4px 14px rgba(220,53,69,0.28); }
.btn-success:hover { box-shadow: 0 4px 14px rgba(25,135,84,0.28); }
.btn-warning:hover { box-shadow: 0 4px 14px rgba(255,193,7,0.28); }

.btn-xs {
  padding: 0.15rem 0.45rem;
  font-size: 0.74rem;
  border-radius: 0.3rem;
}

/* ── Utilities ───────────────────────────────────────────────────────────────── */

.text-navy { color: var(--ir-navy) !important; }
.opacity-60 { opacity: 0.6; }
.cursor-pointer { cursor: pointer; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */

.card {
  border: 1px solid var(--ir-border);
  border-radius: var(--ir-radius);
  box-shadow: var(--ir-shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  background: var(--ir-card-bg);
}
.card-header {
  background: var(--ir-card-bg);
  border-bottom: 1px solid var(--ir-border);
  padding: 0.75rem 1.1rem;
  font-size: 0.9rem;
  border-radius: calc(var(--ir-radius) - 1px) calc(var(--ir-radius) - 1px) 0 0 !important;
}
.card-footer {
  background: #f8fafc;
  border-top: 1px solid var(--ir-border);
  border-radius: 0 0 calc(var(--ir-radius) - 1px) calc(var(--ir-radius) - 1px) !important;
}

/* ── Stat cards (gradient) ───────────────────────────────────────────────────── */

.stat-card {
  border: none !important;
  overflow: hidden;
  position: relative;
}
.stat-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 1.3rem 1.25rem;
  position: relative;
  z-index: 1;
}
/* Decorative circle overlay */
.stat-card::after {
  content: '';
  position: absolute;
  top: -24px;
  right: -24px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
  z-index: 0;
}
.stat-card::before {
  content: '';
  position: absolute;
  bottom: -32px;
  left: -16px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
  z-index: 0;
}

.stat-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
.stat-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18) !important;
}

.stat-navy   { background: linear-gradient(135deg, #1a2c4e 0%, #2d4d85 100%); }
.stat-danger { background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%); }
.stat-ok     { background: linear-gradient(135deg, #15803d 0%, #16a34a 100%); }
.stat-info   { background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%); }
.stat-purple { background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 4px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  flex-shrink: 0;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.stat-label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.72);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

/* ── Colored icon backgrounds (report cards, etc.) ───────────────────────────── */

.bg-navy-light   { background-color: var(--ir-navy-light) !important; }
.bg-danger-light { background-color: #fee2e2 !important; }
.bg-success-light{ background-color: #dcfce7 !important; }
.bg-warning-light{ background-color: #fef9c3 !important; }
.bg-info-light   { background-color: #dbeafe !important; }
.bg-purple-light { background-color: #ede9fe !important; }

.report-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Tables ──────────────────────────────────────────────────────────────────── */

.table {
  font-size: 0.875rem;
  margin-bottom: 0;
}
.table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  font-weight: 700;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}
.table td {
  vertical-align: middle;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}
.table-dark {
  --bs-table-bg: var(--ir-navy);
  --bs-table-border-color: rgba(255,255,255,0.08);
}
.table-dark th {
  color: rgba(255,255,255,0.78) !important;
  font-weight: 700;
}
.table-hover tbody tr:hover {
  background-color: #f1f5fb !important;
}
.table-light th {
  background: #f8fafc !important;
  color: var(--ir-text-muted) !important;
  border-bottom: 1px solid var(--ir-border) !important;
}

/* ── Forms ───────────────────────────────────────────────────────────────────── */

.form-control, .form-select {
  border-color: var(--ir-border);
  border-radius: 0.45rem;
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--ir-navy);
  box-shadow: 0 0 0 0.2rem rgba(26,44,78,0.12);
}
.form-label {
  font-size: 0.845rem;
  margin-bottom: 0.35rem;
  color: var(--ir-text);
}
.input-group .btn {
  border-color: var(--ir-border);
}

/* ── Modals ──────────────────────────────────────────────────────────────────── */

.modal-content {
  border: none;
  border-radius: var(--ir-radius);
  box-shadow: var(--ir-shadow-lg);
}
.modal-header {
  border-bottom: 1px solid var(--ir-border);
  padding: 0.9rem 1.25rem;
}
.modal-footer {
  border-top: 1px solid var(--ir-border);
  padding: 0.75rem 1.25rem;
}

/* ── Badges ──────────────────────────────────────────────────────────────────── */

.badge {
  font-weight: 600;
  letter-spacing: 0.03em;
  border-radius: 0.35rem;
  padding: 0.3em 0.55em;
}

/* ── Toast notifications ─────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1090;
  min-width: 280px;
  max-width: 360px;
}
.toast {
  border-radius: var(--ir-radius-sm);
  box-shadow: var(--ir-shadow-lg);
  border: none;
  font-size: 0.875rem;
}

/* ── Dashboard chevron ───────────────────────────────────────────────────────── */

.dashboard-chevron {
  transition: transform 0.22s ease;
  font-size: 0.85rem;
  opacity: 0.55;
}

/* ── Login page ──────────────────────────────────────────────────────────────── */

.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(150deg, var(--ir-navy) 0%, #0f1e38 60%, #091628 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.975);
  border-radius: 1.25rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.38);
  padding: 2.5rem 2.25rem;
}
.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.login-brand .brand-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, var(--ir-navy) 0%, var(--ir-navy-mid) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem;
  font-size: 2rem;
  color: var(--ir-orange);
  box-shadow: 0 8px 28px rgba(26,44,78,0.32);
}
.login-brand h5 {
  font-weight: 800;
  color: var(--ir-navy);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.login-brand p {
  color: var(--ir-text-muted);
  font-size: 0.82rem;
  margin: 0;
}

/* ── Page header helper ──────────────────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.page-header h4 {
  margin: 0;
  font-weight: 700;
  color: var(--ir-navy);
}

/* ── Mobile ──────────────────────────────────────────────────────────────────── */

/* ── Size picker buttons ─────────────────────────────────────────────────────── */

.size-col {
  border-left: 3px solid var(--ir-navy-light);
  padding-left: 0.6rem;
}
.size-btn-group .size-btn {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.4rem;
  transition: all 0.12s ease;
}
.size-btn-group .size-btn.btn-navy {
  box-shadow: 0 2px 6px rgba(26,44,78,0.25);
}

/* ── Tom Select overrides ────────────────────────────────────────────────────── */

.ts-wrapper .ts-control {
  border-color: var(--ir-border) !important;
  border-radius: 0.45rem !important;
  font-size: 0.9rem !important;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  cursor: default;
}
.ts-wrapper.focus .ts-control,
.ts-wrapper .ts-control:focus-within {
  border-color: var(--ir-navy) !important;
  box-shadow: 0 0 0 0.2rem rgba(26,44,78,0.12) !important;
}
.ts-wrapper .ts-dropdown {
  border-radius: 0.45rem;
  border-color: var(--ir-border);
  box-shadow: var(--ir-shadow-md);
  font-size: 0.9rem;
}
.ts-wrapper .ts-dropdown .option.active,
.ts-wrapper .ts-dropdown .option:hover {
  background-color: var(--ir-navy-light);
  color: var(--ir-navy);
}
.ts-wrapper .ts-dropdown .option.selected {
  background-color: var(--ir-navy);
  color: #fff;
}
.min-w-0 { min-width: 0; }

@media (max-width: 576px) {
  .stat-value     { font-size: 1.65rem; }
  h4              { font-size: 1.05rem; }
  .ir-navbar .navbar-brand { font-size: 0.92rem; }
  .login-card     { padding: 1.75rem 1.5rem; }
  .stat-card .card-body { padding: 1rem; }
  .container-fluid.px-4 { padding-left: 0.9rem !important; padding-right: 0.9rem !important; }
}
