/* ============================================================
   Truvara Chemicals ERP — Main Stylesheet
   ============================================================ */

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --color-primary:       #0FA8C8;
  --color-primary-light: #2EC8E6;
  --color-secondary:     #1B2E4B;
  --color-sidebar:       #132640;
  --color-sidebar-hover: rgba(15,168,200,0.12);
  --color-bg:            #F4F7FA;
  --color-card:          #FFFFFF;
  --color-text:          #1A202C;
  --color-text-muted:    #718096;
  --color-border:        #E4E9F0;
  --color-success:       #38A169;
  --color-danger:        #E53E3E;
  --color-warning:       #D69E2E;
  --color-bg-2:          #EDF1F5;

  --sidebar-width:       92px;
  --topbar-height:       64px;
  --radius:              12px;
  --radius-sm:           8px;
  --shadow-sm:           0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:              0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:           0 10px 30px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);
  --transition:          all 0.25s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  opacity: 0;
  animation: fadeInBody 0.4s ease 0.05s forwards;
  font-size: 0.9375rem;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ─── Animations ────────────────────────────────────────────── */
@keyframes fadeInBody {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0);    }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0);     }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0);    }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg);    opacity: 0.15; }
  50%       { transform: translateY(-20px) rotate(5deg); opacity: 0.25; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Layout ────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar (compact icon rail) ───────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--color-sidebar);
  border-right: none;
  box-shadow: 4px 0 20px rgba(0,0,0,0.18);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  overflow: visible; /* allow flyout submenus to escape */
}

/* Logo area */
.sidebar-header {
  padding: 12px 0;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
  background: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 4px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.sidebar-brand img {
  height: 54px;
  width: auto;
  object-fit: contain;
  padding: 2px;
}

.sidebar-brand-text {
  display: none; /* hidden in compact mode, shown on mobile */
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sidebar-brand-text span { color: var(--color-primary); }

/* Nav container */
.sidebar-nav {
  flex: 1;
  padding: 6px 0;
  overflow: visible;
}

/* Each nav group */
.snav-item {
  position: relative;
  margin: 2px 5px;
}

/* The clickable icon+label tile */
.snav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 4px 7px;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
  gap: 3px;
  position: relative;
}

.snav-link:hover,
.snav-item:hover > .snav-link {
  background: rgba(15,168,200,0.14);
  color: #ffffff;
}

.snav-link.is-active {
  background: rgba(15,168,200,0.2);
  color: #ffffff;
}

.snav-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.snav-label {
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}

/* Chevron arrow (hidden by default, shown in mobile expanded) */
.snav-arrow {
  display: none;
  font-size: 0.7rem;
  margin-left: auto;
  opacity: 0.4;
}

/* Active indicator dot */

/* ── Flyout submenu ──────────────────────────────────────────── */
.snav-fly {
  position: absolute;
  left: 100%;           /* flush against sidebar — no gap to cross */
  top: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 0 10px 10px 0;
  box-shadow: 6px 4px 24px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.07);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
  z-index: 2000;
  pointer-events: none;
  overflow: hidden;
  padding: 4px 0;
}

/* JS adds .fly-open — replaces CSS :hover trigger */
.snav-item.fly-open .snav-fly {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

/* Flyout anchored upward for bottom items */
.snav-fly-up {
  top: auto;
  bottom: 0;
}

/* 2-column wide flyout (e.g. Accounting) */
.snav-fly-wide {
  min-width: 400px;
  display: flex;
  flex-wrap: wrap;
}
.snav-fly-wide .snav-fly-item {
  width: 50%;
  box-sizing: border-box;
}

.snav-fly-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  font-size: 0.855rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.13s ease, padding-left 0.13s ease, color 0.13s ease;
}

.snav-fly-item i {
  width: 15px;
  text-align: center;
  font-size: 0.88rem;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.snav-fly-item:hover {
  background: var(--color-bg);
  color: var(--color-primary);
  padding-left: 20px;
}

.snav-fly-item:hover i { color: var(--color-primary); }

.snav-fly-item.is-active {
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(15,168,200,0.06);
}

.snav-fly-item.is-active i { color: var(--color-primary); }

.snav-fly-danger { color: var(--color-danger) !important; }
.snav-fly-danger i { color: var(--color-danger) !important; }
.snav-fly-danger:hover { background: rgba(229,62,62,0.05) !important; }

/* User card inside flyout */
.snav-fly-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--color-border);
}

/* User avatar in sidebar */
.snav-user-btn {
  cursor: pointer;
}

.snav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 6px 0 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ─── Topbar ────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  height: var(--topbar-height);
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 8px rgba(19,38,64,0.07);
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--color-text);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.topbar-toggle:hover {
  background: var(--color-bg);
}

.topbar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}

.topbar-page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  padding: 0.375rem 0.75rem;
  border-radius: 50px;
  border: none;
  background: none;
  transition: var(--transition);
}

.topbar-user:hover {
  background: var(--color-bg);
}

.topbar-user-info {
  text-align: right;
  line-height: 1.2;
}

.topbar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.topbar-user-role {
  font-size: 0.725rem;
  color: var(--color-text-muted);
}

/* ─── Page Content ──────────────────────────────────────────── */
.page-content {
  padding: 1.5rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.breadcrumb-item.active { color: var(--color-text-muted); }
.breadcrumb-item a { color: var(--color-primary); }

/* ─── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.card-body { padding: 1.25rem; }

/* ─── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.stat-icon.green  { background: rgba(15,168,200,0.1);  color: var(--color-primary); }
.stat-icon.blue   { background: rgba(27,46,75,0.1); color: var(--color-secondary); }
.stat-icon.teal   { background: rgba(0,184,138,0.1); color: var(--color-primary-light); }
.stat-icon.orange { background: rgba(214,158,46,0.1);color: var(--color-warning); }

.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-top: 0.4rem;
}

.stat-trend.up   { background: rgba(56,161,105,0.1); color: var(--color-success); }
.stat-trend.down { background: rgba(229,62,62,0.1);  color: var(--color-danger);  }
.stat-trend.flat { background: rgba(113,128,150,0.1);color: var(--color-text-muted); }

/* ─── Animate Cards ─────────────────────────────────────────── */
.animate-card {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

/* ─── Tables ─────────────────────────────────────────────────── */
.table {
  font-size: 0.875rem;
}

.table thead th {
  background: #EFF4F8;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-color: var(--color-border);
}

.table tbody tr {
  transition: background 0.15s;
}

.table tbody tr:hover {
  background: rgba(0, 122, 90, 0.03);
}

/* ─── Badges ─────────────────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.badge-status.active   { background: rgba(56,161,105,0.1); color: var(--color-success); }
.badge-status.active::before { background: var(--color-success); animation: pulse 2s infinite; }
.badge-status.inactive { background: rgba(229,62,62,0.1);  color: var(--color-danger);  }
.badge-status.inactive::before { background: var(--color-danger); }

.badge-role {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(27,46,75,0.08);
  color: var(--color-secondary);
  border: 1px solid rgba(27,46,75,0.15);
}

.badge-system {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(214,158,46,0.1);
  color: var(--color-warning);
  border: 1px solid rgba(214,158,46,0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ─── Avatar / Initials ──────────────────────────────────────── */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  user-select: none;
}

.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 0.875rem;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 0.65rem;
}

/* Avatar color based on first letter */
.avatar[data-letter="A"], .avatar[data-letter="N"] { background: #E53E3E; }
.avatar[data-letter="B"], .avatar[data-letter="O"] { background: #DD6B20; }
.avatar[data-letter="C"], .avatar[data-letter="P"] { background: #D69E2E; }
.avatar[data-letter="D"], .avatar[data-letter="Q"] { background: #38A169; }
.avatar[data-letter="E"], .avatar[data-letter="R"] { background: #2EC8E6; }
.avatar[data-letter="F"], .avatar[data-letter="S"] { background: #0FA8C8; }
.avatar[data-letter="G"], .avatar[data-letter="T"] { background: #3182CE; }
.avatar[data-letter="H"], .avatar[data-letter="U"] { background: #1B2E4B; }
.avatar[data-letter="I"], .avatar[data-letter="V"] { background: #6B46C1; }
.avatar[data-letter="J"], .avatar[data-letter="W"] { background: #D53F8C; }
.avatar[data-letter="K"], .avatar[data-letter="X"] { background: #2D3748; }
.avatar[data-letter="L"], .avatar[data-letter="Y"] { background: #E53E3E; }
.avatar[data-letter="M"], .avatar[data-letter="Z"] { background: #3182CE; }

/* ─── Toggle Switch ──────────────────────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CBD5E0;
  border-radius: 24px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary-custom {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary-custom:hover {
  background: var(--color-primary-light);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15,168,200,0.3);
}

.btn-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.btn-action:hover { color: var(--color-text); border-color: #CBD5E0; background: var(--color-bg); }
.btn-action.edit:hover  { color: var(--color-secondary); border-color: var(--color-secondary); }
.btn-action.delete:hover{ color: var(--color-danger);    border-color: var(--color-danger); }

/* ─── Form Controls ──────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15,168,200,0.12);
}

.form-control.is-invalid, .form-select.is-invalid {
  border-color: var(--color-danger);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(229,62,62,0.12);
}

.form-control::placeholder,
.form-select::placeholder,
input::placeholder,
textarea::placeholder {
  color: #B0BAC9;
  opacity: 1;
}

.invalid-feedback {
  font-size: 0.8rem;
  color: var(--color-danger);
  margin-top: 0.25rem;
  display: block;
}

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

.input-group-custom {
  position: relative;
}

.input-group-custom .form-control {
  padding-left: 2.75rem;
}

.input-group-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
}

.input-group-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.2s;
}

.input-group-btn:hover { color: var(--color-text); }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination .page-link {
  color: var(--color-primary);
  border-color: var(--color-border);
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  font-size: 0.825rem;
  padding: 0.375rem 0.75rem;
}

.pagination .page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.pagination .page-link:hover {
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ─── Module Cards ───────────────────────────────────────────── */
.module-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 2px solid var(--color-border);
  transition: var(--transition);
  cursor: grab;
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.module-card:hover {
  border-color: rgba(15,168,200,0.3);
  box-shadow: 0 8px 24px rgba(15,168,200,0.12);
  transform: translateY(-2px);
}

.module-card:hover::before {
  transform: scaleX(1);
}

.module-card.disabled {
  opacity: 0.6;
}

.module-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(15,168,200,0.1);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.875rem;
}

.module-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.25rem;
}

.module-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin: 0;
}

.drag-handle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: var(--color-text-muted);
  opacity: 0;
  font-size: 0.875rem;
  transition: opacity 0.2s;
}

.module-card:hover .drag-handle { opacity: 1; }

/* ─── Role Cards ─────────────────────────────────────────────── */
.role-card {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1.5px solid var(--color-border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.role-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.role-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(15,168,200,0.2);
  transform: translateY(-2px);
}

.role-card:hover::after {
  transform: scaleX(1);
}

.role-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.375rem;
}

.role-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}

.role-perm-summary {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
}

/* ─── Permissions Accordion ──────────────────────────────────── */
.perm-module-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  border: 1.5px solid var(--color-border);
}

.perm-module-header:hover {
  background: rgba(15,168,200,0.05);
  border-color: rgba(15,168,200,0.2);
}

.perm-module-body {
  padding: 1rem;
  border: 1.5px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.perm-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
}

.perm-check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  font-weight: 500;
}

.perm-check-item:hover {
  border-color: var(--color-primary);
  background: rgba(15,168,200,0.04);
}

.perm-check-item input:checked + span {
  color: var(--color-primary);
}

/* ─── Flash Messages ──────────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 9999;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flash-alert {
  border-radius: var(--radius-sm);
  padding: 0.875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: var(--shadow);
  animation: fadeInRight 0.3s ease;
  border: none;
}

/* ─── Searchbar ───────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-input-wrap .form-control {
  padding-left: 2.5rem;
}

.search-input-wrap .bi {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

/* ─── List Bar (replaces page-header + filter card) ─────────── */
.list-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.list-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  line-height: 1.4;
}
.list-view-btn:hover,
.list-view-btn:focus { background: var(--color-bg-2); outline: none; border-color: var(--color-border); }
.list-view-btn .lv-count {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(15,168,200,0.12);
  color: var(--color-primary);
  font-weight: 700;
}

.list-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 160px;
}
.list-search-wrap > .bi {
  position: absolute;
  left: 10px;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  pointer-events: none;
  z-index: 1;
}
.list-search-wrap input[type="text"] {
  width: 100%;
  padding: 7px 32px 7px 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: #ffffff;
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.list-search-wrap input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15,168,200,0.1);
}
.list-search-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
  text-decoration: none;
  display: flex;
  align-items: center;
}
.list-search-clear:hover { color: var(--color-danger); }

.list-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.list-bar-extra {
  flex-shrink: 0;
}
.list-bar-extra select,
.list-bar-extra input[type="date"] {
  height: 34px;
  font-size: 0.82rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--color-text);
  padding: 0 8px;
}
.list-bar-extra select:focus,
.list-bar-extra input[type="date"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(15,168,200,0.1);
}

.list-view-menu { min-width: 200px; }
.list-view-menu .dropdown-item {
  font-size: 0.84rem;
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text);
}
.list-view-menu .dropdown-item.active,
.list-view-menu .dropdown-item:active {
  background: rgba(15,168,200,0.08);
  color: var(--color-primary);
}
.list-view-menu .lv-count {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0,0,0,0.07);
  color: var(--color-text-muted);
  font-weight: 600;
}
.list-view-menu .dropdown-item.active .lv-count {
  background: rgba(15,168,200,0.15);
  color: var(--color-primary);
}

/* ─── Lifecycle Empty State ──────────────────────────────────── */
.lc-empty {
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 1.5rem;
  align-items: start;
}
.lc-empty-title {
  grid-column: 1;
  grid-row: 1;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lc-flow {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 0;
  align-self: start;
}
.lc-step {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  border: 1.5px solid;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--color-bg);
  min-width: 60px;
}
.lc-step i { font-size: 0.82rem; }
.lc-step.lc-draft    { border-color: #adb5bd; color: #6c757d; }
.lc-step.lc-sent     { border-color: #0d6efd; color: #0a58ca; }
.lc-step.lc-unpaid   { border-color: #fd7e14; color: #7b3d00; background: #fff8f3; }
.lc-step.lc-overdue  { border-color: #dc3545; color: #842029; border-style: dashed; background: #fff5f5; }
.lc-step.lc-partial  { border-color: #fd7e14; color: #664d03; border-style: dashed; background: #fffbf0; }
.lc-step.lc-paid     { border-color: #198754; color: #0a3622; background: #f0fff4; }
.lc-step.lc-accepted { border-color: #198754; color: #0a3622; background: #f0fff4; }
.lc-step.lc-rejected { border-color: #dc3545; color: #842029; border-style: dashed; background: #fff5f5; }
.lc-step.lc-expired  { border-color: #fd7e14; color: #7b3d00; border-style: dashed; background: #fff8f3; }
.lc-step.lc-invoiced { border-color: #6f42c1; color: #432874; background: #f5f0ff; }
.lc-step.lc-approved { border-color: #198754; color: #0a3622; background: #f0fff4; }
.lc-step.lc-reimbursed { border-color: #0d6efd; color: #0a58ca; background: #f0f4ff; }
.lc-step.lc-submitted { border-color: #17a2b8; color: #0a6a78; }
.lc-step.lc-customer { border-color: #0FA8C8; color: #0FA8C8; background: rgba(15,168,200,0.04); }
.lc-step.lc-vendor   { border-color: #1B2E4B; color: #1B2E4B; background: rgba(27,46,75,0.04); }
.lc-step.lc-both     { border-color: #D69E2E; color: #92610a; background: rgba(214,158,46,0.06); }
.lc-step.lc-bill     { border-color: #6c757d; color: #495057; }
.lc-step.lc-void     { border-color: #adb5bd; color: #6c757d; border-style: dashed; }
.lc-step.lc-received { border-color: #198754; color: #0a3622; background: #f0fff4; }

.lc-arrow {
  color: #adb5bd;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.lc-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.lc-sep {
  display: none;
}

/* Feature cards */
.lc-features {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding: 0;
  border-left: 1px solid var(--color-border);
  padding-left: 1.25rem;
  align-content: start;
}
.lc-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.35rem 0;
  text-align: left;
}
.lc-feature-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.lc-feature h6 {
  font-size: 0.77rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.1rem;
}
.lc-feature p {
  font-size: 0.71rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin: 0;
}

@media (max-width: 767.98px) {
  .lc-empty { grid-template-columns: 1fr; }
  .lc-flow { grid-row: 2; }
  .lc-features { grid-column: 1; grid-row: 3; border-left: none; padding-left: 0; border-top: 1px solid var(--color-border); padding-top: 0.75rem; margin-top: 0.5rem; }
  .lc-flow { gap: 3px; }
  .lc-step { min-width: 52px; padding: 4px 8px; }
}

/* ─── Auth Layout ────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
}

.auth-panel-left {
  width: 50%;
  background: linear-gradient(150deg, #132640 0%, #1B3D6E 55%, #0FA8C8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
  animation: fadeInLeft 0.6s ease;
}

.auth-panel-right {
  width: 50%;
  background: var(--color-card);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  animation: fadeInRight 0.6s ease;
}

.auth-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  animation: float 6s ease-in-out infinite;
}

.auth-shape:nth-child(1) { width: 200px; height: 200px; top: -60px; right: -60px; animation-delay: 0s; }
.auth-shape:nth-child(2) { width: 140px; height: 140px; bottom: 80px; left: -40px; animation-delay: -2s; }
.auth-shape:nth-child(3) { width: 80px;  height: 80px;  top: 40%;  right: 15%;    animation-delay: -4s; }

.auth-brand {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.auth-logo-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 28px;
  margin-bottom: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.auth-logo-card img {
  height: 52px;
  width: auto;
  display: block;
}

.auth-brand img {
  height: 70px;
  width: auto;
  filter: brightness(1.1) drop-shadow(0 2px 8px rgba(0,0,0,0.25));
}

.auth-brand-name {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

.auth-brand-tagline {
  font-size: 0.925rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.25rem;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.auth-features li:last-child { border-bottom: none; }

.auth-features li .bi {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
}

.auth-form-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.auth-form-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.btn-auth {
  background: var(--color-primary);
  color: white;
  border: none;
  width: 100%;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-auth:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15,168,200,0.3);
}

.btn-auth:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-auth .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.btn-auth.loading .spinner { display: block; }
.btn-auth.loading .btn-text { display: none; }

/* ─── Activity Log Table ─────────────────────────────────────── */
.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.activity-icon.login    { background: rgba(56,161,105,0.1);  color: var(--color-success); }
.activity-icon.logout   { background: rgba(113,128,150,0.1); color: var(--color-text-muted); }
.activity-icon.create   { background: rgba(0,184,138,0.1);   color: var(--color-primary-light); }
.activity-icon.update   { background: rgba(27,46,75,0.1);   color: var(--color-secondary); }
.activity-icon.delete   { background: rgba(229,62,62,0.1);   color: var(--color-danger); }
.activity-icon.toggle   { background: rgba(214,158,46,0.1);  color: var(--color-warning); }
.activity-icon.reorder  { background: rgba(107,70,193,0.1);  color: #6B46C1; }
.activity-icon.default  { background: rgba(15,168,200,0.1);    color: var(--color-primary); }

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.35;
}

.empty-state p { font-size: 0.9rem; }

/* ─── 404 Page ───────────────────────────────────────────────── */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem;
}

.error-code {
  font-size: 7rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.6s ease;
}

.error-message {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin: 1rem 0 2rem;
}

/* ─── Sidebar overlay for mobile ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  /* On mobile: sidebar is full-width expanded panel, hidden off-screen */
  .sidebar {
    width: 220px;
    transform: translateX(-100%);
    overflow-y: auto;
    overflow-x: visible;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Show brand text on mobile expanded sidebar */
  .sidebar-brand { flex-direction: row; gap: 8px; }
  .sidebar-brand-text { display: flex; }

  /* Nav items go horizontal with text on mobile */
  .snav-link {
    flex-direction: row;
    justify-content: flex-start;
    padding: 10px 14px;
    gap: 10px;
  }

  .snav-label {
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
    white-space: normal;
  }

  .snav-icon { font-size: 1.1rem; }
  .snav-arrow { display: block; }
  .snav-link.is-active::before { display: none; }

  /* Flyouts become accordion-style (hidden on mobile, navigate via main link) */
  .snav-fly { display: none; }

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

  .topbar-toggle {
    display: flex;
    align-items: center;
  }

  .auth-panel-left { display: none; }
  .auth-panel-right { width: 100%; }
}

@media (max-width: 575.98px) {
  .page-content {
    padding: 1rem;
  }

  .flash-container {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .stat-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}

/* ─── Utilities ──────────────────────────────────────────────── */
.text-primary-custom { color: var(--color-primary) !important; }
.text-muted-custom   { color: var(--color-text-muted) !important; }
.bg-primary-custom   { background: var(--color-primary) !important; }
.fw-600              { font-weight: 600 !important; }
.fw-700              { font-weight: 700 !important; }
.gap-2               { gap: 0.5rem; }
.gap-3               { gap: 0.75rem; }

/* ═══════════════════════════════════════════════════════════════
   Bootstrap 5 — Truvara Theme Overrides
   (loaded after bootstrap.min.css so these win)
   ═══════════════════════════════════════════════════════════════ */

/* ── Global BS5 tokens ──────────────────────────────────────── */
:root {
  --bs-primary:          #0FA8C8;
  --bs-primary-rgb:      15, 168, 200;
  --bs-link-color:       #0FA8C8;
  --bs-link-hover-color: #0d96b3;
  --bs-focus-ring-color: rgba(15,168,200,0.25);
}

/* ── .btn-primary ───────────────────────────────────────────── */
.btn-primary {
  --bs-btn-bg:                  #0FA8C8;
  --bs-btn-border-color:        #0FA8C8;
  --bs-btn-hover-bg:            #0d96b3;
  --bs-btn-hover-border-color:  #0d96b3;
  --bs-btn-active-bg:           #0b87a1;
  --bs-btn-active-border-color: #0b87a1;
  --bs-btn-focus-shadow-rgb:    15, 168, 200;
  --bs-btn-color:               #fff;
  --bs-btn-hover-color:         #fff;
  --bs-btn-active-color:        #fff;
  font-weight: 600;
}

/* ── .btn-outline-primary ───────────────────────────────────── */
.btn-outline-primary {
  --bs-btn-color:               #0FA8C8;
  --bs-btn-border-color:        #0FA8C8;
  --bs-btn-hover-bg:            #0FA8C8;
  --bs-btn-hover-border-color:  #0FA8C8;
  --bs-btn-hover-color:         #fff;
  --bs-btn-active-bg:           #0d96b3;
  --bs-btn-active-border-color: #0d96b3;
  --bs-btn-focus-shadow-rgb:    15, 168, 200;
}

/* ── .btn-secondary — soft neutral ─────────────────────────── */
.btn-secondary {
  --bs-btn-bg:            #E8EEF5;
  --bs-btn-border-color:  #D1DAE6;
  --bs-btn-color:         #1B2E4B;
  --bs-btn-hover-bg:      #D8E2EE;
  --bs-btn-hover-color:   #1B2E4B;
  --bs-btn-hover-border-color: #C2CFDF;
  --bs-btn-active-bg:     #C8D6E6;
  font-weight: 500;
}

/* ── .btn-outline-secondary ─────────────────────────────────── */
.btn-outline-secondary {
  --bs-btn-color:               #718096;
  --bs-btn-border-color:        #D1DAE6;
  --bs-btn-hover-bg:            #E8EEF5;
  --bs-btn-hover-color:         #1B2E4B;
  --bs-btn-hover-border-color:  #C2CFDF;
  --bs-btn-active-bg:           #D8E2EE;
  --bs-btn-active-color:        #1B2E4B;
  --bs-btn-focus-shadow-rgb:    113, 128, 150;
}

/* ── .btn-success ───────────────────────────────────────────── */
.btn-success {
  --bs-btn-bg:            #38A169;
  --bs-btn-border-color:  #38A169;
  --bs-btn-hover-bg:      #2F8A57;
  --bs-btn-hover-border-color: #2F8A57;
  --bs-btn-focus-shadow-rgb: 56, 161, 105;
}

/* ── Text / BG / Border helpers ─────────────────────────────── */
.text-primary  { color: #0FA8C8 !important; }
.bg-primary    { background-color: #0FA8C8 !important; }
.border-primary { border-color: #0FA8C8 !important; }
a { color: #0FA8C8; }
a:hover { color: #0d96b3; }

/* ── Checkboxes & radios ────────────────────────────────────── */
.form-check-input:checked {
  background-color: #0FA8C8;
  border-color: #0FA8C8;
}
.form-check-input:focus {
  border-color: #0FA8C8;
  box-shadow: 0 0 0 0.2rem rgba(15,168,200,0.2);
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge.bg-primary  { background-color: #0FA8C8 !important; }
.badge.bg-secondary {
  background-color: #E8EEF5 !important;
  color: #1B2E4B !important;
}
.badge.bg-secondary-subtle { background-color: #E8EEF5 !important; }
.badge.text-secondary { color: #4A6080 !important; }

/* ── Nav tabs / pills active ────────────────────────────────── */
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: #0FA8C8;
  border-bottom-color: #0FA8C8;
}
.nav-pills .nav-link.active {
  background-color: #0FA8C8;
}

/* ── Dropdowns ──────────────────────────────────────────────── */
.dropdown-item.active,
.dropdown-item:active {
  background-color: #0FA8C8;
  color: #fff;
}

/* ── Progress bars ──────────────────────────────────────────── */
.progress-bar { background-color: #0FA8C8; }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner-border.text-primary,
.spinner-grow.text-primary { color: #0FA8C8 !important; }

/* ═══════════════════════════════════════════════════════════════
   Listing / Table UI Improvements
   ═══════════════════════════════════════════════════════════════ */

/* ── Card: teal top-accent strip ───────────────────────────── */
.card {
  border-radius: 14px;
  border: 1px solid #E4ECF3;
}

.card.animate-card {
  border-top: 3px solid #0FA8C8;
}

/* ── Card header ────────────────────────────────────────────── */
.card-header {
  background: linear-gradient(to right, #F7FAFD, #EFF4FA);
  border-bottom: 1px solid #E4ECF3;
  border-radius: 14px 14px 0 0 !important;
}

/* ── Table header ───────────────────────────────────────────── */
.table thead th {
  background: linear-gradient(to bottom, #F0F5FB, #EAF0F8);
  color: #1B2E4B;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.7rem 1rem;
  border-bottom: 2px solid #D8E4F0;
  white-space: nowrap;
}

/* ── Table rows ─────────────────────────────────────────────── */
.table tbody td {
  padding: 0.8rem 1rem;
  vertical-align: middle;
  border-color: #EDF2F7;
  font-size: 0.865rem;
}

.table tbody tr { transition: background 0.12s; }

.table tbody tr:hover { background: #F0F8FB; }

.table tbody tr:last-child td { border-bottom: none; }

/* ── List bar improvements ──────────────────────────────────── */
.list-bar {
  background: #fff;
  border: 1px solid #E4ECF3;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(19,38,64,0.05);
  margin-bottom: 14px;
}

.list-view-btn {
  background: #F0F5FB;
  border: 1px solid #D8E4F0;
  border-radius: 8px;
  color: #1B2E4B;
  font-weight: 600;
  font-size: 0.82rem;
}
.list-view-btn:hover { background: #E4EEF8; }

.list-search-wrap input[type="text"] {
  background: #F7FAFD;
  border: 1px solid #D8E4F0;
  border-radius: 8px;
}
.list-search-wrap input[type="text"]:focus {
  background: #fff;
  border-color: #0FA8C8;
  box-shadow: 0 0 0 3px rgba(15,168,200,0.1);
}

.list-bar-extra select,
.list-bar-extra input[type="date"] {
  background: #F7FAFD;
  border: 1px solid #D8E4F0;
  border-radius: 8px;
  color: #1B2E4B;
}

/* ── Topbar action buttons (sm) ─────────────────────────────── */
.btn-sm {
  border-radius: 7px;
  font-size: 0.82rem;
  padding: 0.35rem 0.85rem;
}

/* ── Status badges ───────────────────────────────────────────── */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 6px;
  padding: 0.3em 0.65em;
}

/* Bootstrap subtle variants → Truvara palette */
.bg-success-subtle  { background-color: rgba(56,161,105,0.1)  !important; }
.bg-danger-subtle   { background-color: rgba(229,62,62,0.1)   !important; }
.bg-warning-subtle  { background-color: rgba(214,158,46,0.1)  !important; }
.bg-primary-subtle  { background-color: rgba(15,168,200,0.1)  !important; }
.text-success { color: #2F8A57 !important; }
.text-danger  { color: #C53030 !important; }
.text-warning { color: #B7791F !important; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { gap: 3px; }
.pagination .page-link {
  border-radius: 7px !important;
  border: 1px solid #D8E4F0;
  color: #1B2E4B;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  transition: all 0.15s;
}
.pagination .page-link:hover {
  background: #EEF5FB;
  border-color: #0FA8C8;
  color: #0FA8C8;
}
.pagination .page-item.active .page-link {
  background: #0FA8C8;
  border-color: #0FA8C8;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15,168,200,0.3);
}
.pagination .page-item.disabled .page-link {
  background: #F7FAFD;
  color: #A0AEC0;
  border-color: #E4ECF3;
}

/* ── Action buttons in table rows ───────────────────────────── */
.btn-action {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid #E4ECF3;
  background: #F7FAFD;
}
.btn-action:hover        { background: #EEF4FB; border-color: #C8D8EA; }
.btn-action.edit:hover   { color: #0FA8C8; border-color: #0FA8C8; background: rgba(15,168,200,0.06); }
.btn-action.delete:hover { color: #E53E3E; border-color: #E53E3E; background: rgba(229,62,62,0.05); }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state {
  padding: 3.5rem 2rem;
}
.empty-state-icon {
  font-size: 2.8rem;
  color: #CBD5E0;
  margin-bottom: 0.875rem;
  opacity: 1;
}
.empty-state h6 {
  color: #1B2E4B;
  font-size: 0.95rem;
  font-weight: 700;
}
.empty-state p {
  font-size: 0.82rem;
  color: #A0AEC0;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-header {
  border-bottom: 1px solid #E4ECF3;
  padding: 1rem 1.25rem 0.875rem;
}
.modal-footer {
  border-top: 1px solid #E4ECF3;
  padding: 0.875rem 1.25rem;
}
.modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(19,38,64,0.15);
}

/* ── Print (global) ─────────────────────────────────────────── */
@media print {
  .sidebar, .sidebar-overlay, .topbar, .no-print { display: none !important; }
  .app-wrapper { display: block !important; }
  .page-content, .content-area, main { margin-left: 0 !important; padding: 0 !important; }
  .card { border: 1px solid #ddd !important; box-shadow: none !important; page-break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
  body { background: #fff !important; font-size: 10pt; }
}
