/* ============================================================
   Byn Flow ERP - Main Stylesheet
   Fonts: Teko (headings) | Barlow Semi Condensed (body)
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --baltic-blue:   #05668d;
  --rich-cerulean: #427aa1;
  --alice-blue:    #ebf2fa;
  --sage-green:    #679436;
  --lime-moss:     #a5be00;
  --black:         #0d0f12;
  --white:         #ffffff;

  /* Derived */
  --sidebar-bg:    #0a1628;
  --sidebar-width: 260px;
  --topbar-h:      64px;
  --card-radius:   12px;
  --input-radius:  8px;
  --btn-radius:    8px;
  --transition:    0.22s ease;

  /* Text */
  --text-primary:   #0d0f12;
  --text-secondary: #5a6474;
  --text-muted:     #9aa3af;

  /* Borders */
  --border:         #dde4ef;
  --border-light:   #eef2f8;

  /* Status */
  --success: #679436;
  --warning: #e6a817;
  --danger:  #d94f3d;
  --info:    #427aa1;

  /* Shadows */
  --shadow-sm:  0 1px 4px rgba(5,102,141,0.08);
  --shadow-md:  0 4px 16px rgba(5,102,141,0.12);
  --shadow-lg:  0 8px 32px rgba(5,102,141,0.16);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--alice-blue);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Teko', sans-serif;
  font-weight: 500;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

a { color: var(--baltic-blue); text-decoration: none; }
a:hover { color: var(--rich-cerulean); }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5d0e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--rich-cerulean); }

/* ── Preloader ────────────────────────────────────────────── */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--sidebar-bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.preloader-done { opacity: 0; visibility: hidden; }

.preloader-inner { text-align: center; }

.preloader-logo {
  animation: preloaderPulse 1.4s ease-in-out infinite;
  margin-bottom: 16px;
}
.preloader-brand {
  font-family: 'Teko', sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 2px;
  margin-bottom: 28px;
}
.preloader-bar {
  width: 200px; height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px; overflow: hidden;
  margin: 0 auto 14px;
}
.preloader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--baltic-blue), var(--lime-moss), var(--sage-green));
  border-radius: 2px;
  animation: preloaderBar 1.8s ease-in-out infinite;
}
.preloader-text {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  text-transform: uppercase;
}

@keyframes preloaderPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.08); opacity: 0.8; }
}
@keyframes preloaderBar {
  0%   { width: 0%; margin-left: 0; }
  50%  { width: 80%; margin-left: 10%; }
  100% { width: 0%; margin-left: 100%; }
}

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

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width); height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition), width var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.logo-link {
  display: flex; align-items: center; gap: 12px;
  flex: 1; overflow: hidden;
}
.logo-icon { flex-shrink: 0; }
.logo-text { overflow: hidden; }
.logo-brand {
  display: block;
  font-family: 'Teko', sans-serif;
  font-size: 22px; font-weight: 600;
  color: var(--white);
  line-height: 1;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.logo-sub {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.sidebar-close {
  display: none; background: none; border: none;
  color: rgba(255,255,255,0.4); padding: 4px;
  flex-shrink: 0;
}
.sidebar-close:hover { color: var(--white); }

/* Nav */
.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 12px 0;
}
.nav-group { margin-bottom: 4px; }
.nav-group-label {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.25);
  padding: 14px 20px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.55);
  transition: all var(--transition);
  position: relative; overflow: hidden;
  font-size: 14px; font-weight: 400;
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}
.nav-item.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(5,102,141,0.5), rgba(5,102,141,0.15));
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--lime-moss);
  border-radius: 0 2px 2px 0;
}
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-label { flex: 1; }

/* Sidebar Footer */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sf-user {
  display: flex; align-items: center; gap: 10px;
}
.sf-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--baltic-blue), var(--rich-cerulean));
  color: white; font-family: 'Teko',sans-serif; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sf-info { flex: 1; overflow: hidden; }
.sf-name {
  font-size: 13px; font-weight: 500; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sf-role { font-size: 11px; color: rgba(255,255,255,0.35); }
.sf-logout {
  color: rgba(255,255,255,0.3); padding: 6px;
  transition: color var(--transition);
}
.sf-logout:hover { color: #d94f3d; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 999;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.top-bar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
}
.top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-bar-right { display: flex; align-items: center; gap: 8px; }

.sidebar-toggle {
  background: none; border: none;
  color: var(--text-secondary); padding: 8px;
  border-radius: 8px; transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--alice-blue); color: var(--baltic-blue); }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--baltic-blue); }
.bc-current { color: var(--text-primary); font-weight: 500; }
.bc-sep { display: flex; align-items: center; color: var(--border); }

/* Clock */
.topbar-clock {
  font-family: 'Teko', sans-serif;
  font-size: 17px; color: var(--text-secondary);
  padding: 0 8px;
}

/* Topbar Button */
.topbar-btn {
  position: relative;
  background: none; border: none;
  color: var(--text-secondary);
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.topbar-btn:hover { background: var(--alice-blue); color: var(--baltic-blue); }

.notif-badge {
  position: absolute; top: 6px; right: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: white;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white);
}

/* User Menu Trigger */
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid var(--border-light);
  border-radius: 10px; padding: 6px 12px 6px 8px;
  transition: all var(--transition);
}
.topbar-user:hover { background: var(--alice-blue); border-color: var(--border); }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--baltic-blue), var(--rich-cerulean));
  color: white; font-family: 'Teko', sans-serif; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.user-info { text-align: left; }
.user-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-role  { font-size: 11px; color: var(--text-muted); line-height: 1.2; }
.user-caret { color: var(--text-muted); transition: transform var(--transition); }

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  min-width: 200px; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 200;
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header {
  padding: 12px 16px 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-secondary);
  font-size: 14px; transition: all var(--transition);
}
.dropdown-item:hover { background: var(--alice-blue); color: var(--baltic-blue); }
.dropdown-item.text-danger { color: var(--danger); }
.dropdown-item.text-danger:hover { background: #fdf0ee; }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }
.dropdown-empty { padding: 16px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Notification menu */
.notif-menu { min-width: 300px; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.notif-warning { background: #fff3cd; color: var(--warning); }
.notif-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.notif-sub   { font-size: 11px; color: var(--text-muted); }

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  flex: 1; padding: 28px 28px 40px;
}

/* Page Header */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 28px; gap: 16px;
}
.page-header-left h1 {
  font-size: 32px; font-weight: 600; color: var(--text-primary);
  line-height: 1.1;
}
.page-header-left p {
  font-size: 14px; color: var(--text-muted); margin-top: 4px;
}
.page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-family: 'Teko', sans-serif;
  font-size: 20px; font-weight: 500; color: var(--text-primary);
}
.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  background: #fafbfd;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--card-radius);
  padding: 22px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.06; transform: translate(20px, -20px);
}
.stat-card.blue::before   { background: var(--baltic-blue); }
.stat-card.teal::before   { background: var(--rich-cerulean); }
.stat-card.green::before  { background: var(--sage-green); }
.stat-card.lime::before   { background: var(--lime-moss); }
.stat-card.orange::before { background: #e6a817; }
.stat-card.red::before    { background: var(--danger); }

.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.stat-card.blue  .stat-icon { background: rgba(5,102,141,0.1);  color: var(--baltic-blue); }
.stat-card.teal  .stat-icon { background: rgba(66,122,161,0.1); color: var(--rich-cerulean); }
.stat-card.green .stat-icon { background: rgba(103,148,54,0.1); color: var(--sage-green); }
.stat-card.lime  .stat-icon { background: rgba(165,190,0,0.12); color: #7a8e00; }
.stat-card.orange .stat-icon { background: rgba(230,168,23,0.1); color: #b07800; }
.stat-card.red   .stat-icon { background: rgba(217,79,61,0.1);  color: var(--danger); }

.stat-value {
  font-family: 'Teko', sans-serif;
  font-size: 38px; font-weight: 600;
  color: var(--text-primary); line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 13px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--btn-radius);
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--baltic-blue); color: var(--white);
  border-color: var(--baltic-blue);
}
.btn-primary:hover { background: #044f6a; color: var(--white); border-color: #044f6a; }

.btn-secondary {
  background: var(--rich-cerulean); color: var(--white);
  border-color: var(--rich-cerulean);
}
.btn-secondary:hover { background: #356490; color: var(--white); }

.btn-success {
  background: var(--sage-green); color: var(--white);
  border-color: var(--sage-green);
}
.btn-success:hover { background: #52772b; color: var(--white); }

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

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

.btn-outline {
  background: transparent; color: var(--baltic-blue);
  border-color: var(--baltic-blue);
}
.btn-outline:hover { background: var(--baltic-blue); color: var(--white); }

.btn-ghost {
  background: var(--alice-blue); color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--border); color: var(--text-primary); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.2px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--input-radius);
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 14px; color: var(--text-primary);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--baltic-blue);
  box-shadow: 0 0 0 3px rgba(5,102,141,0.12);
}
.form-control:disabled { background: #f5f7fa; color: var(--text-muted); cursor: not-allowed; }
.form-control.is-invalid { border-color: var(--danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(217,79,61,0.12); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%235a6474'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}

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

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 20px;
}

.form-check {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 18px; height: 18px;
  accent-color: var(--baltic-blue);
  cursor: pointer;
}

/* Input groups */
.input-group { position: relative; display: flex; }
.input-group .form-control { flex: 1; }
.input-group .input-group-addon {
  display: flex; align-items: center; padding: 0 14px;
  background: var(--alice-blue); border: 1.5px solid var(--border);
  color: var(--text-secondary); font-size: 14px;
  border-radius: var(--input-radius) 0 0 var(--input-radius);
  border-right: none;
}
.input-group .form-control { border-radius: 0 var(--input-radius) var(--input-radius) 0; }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.data-table {
  width: 100%; border-collapse: collapse;
}
.data-table th {
  padding: 12px 16px;
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted);
  background: #fafbfd;
  border-bottom: 2px solid var(--border-light);
  white-space: nowrap;
  text-align: left;
}
.data-table td {
  padding: 13px 16px;
  font-size: 14px; color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: #fafbfd; }

.table-actions { display: flex; gap: 6px; align-items: center; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success  { background: rgba(103,148,54,0.12);  color: var(--sage-green); }
.badge-danger   { background: rgba(217,79,61,0.12);   color: var(--danger); }
.badge-warning  { background: rgba(230,168,23,0.12);  color: #9a6d00; }
.badge-info     { background: rgba(66,122,161,0.12);  color: var(--rich-cerulean); }
.badge-primary  { background: rgba(5,102,141,0.12);   color: var(--baltic-blue); }
.badge-secondary{ background: rgba(90,100,116,0.1);   color: var(--text-secondary); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 10px;
  margin-bottom: 20px; font-size: 14px;
  border: 1px solid transparent; position: relative;
}
.alert-close {
  margin-left: auto; background: none; border: none;
  opacity: 0.5; cursor: pointer; padding: 2px;
  transition: opacity var(--transition);
}
.alert-close:hover { opacity: 1; }
.alert-success { background: rgba(103,148,54,0.1);  border-color: rgba(103,148,54,0.3);  color: #3a5420; }
.alert-error   { background: rgba(217,79,61,0.1);   border-color: rgba(217,79,61,0.3);   color: #8b2217; }
.alert-warning { background: rgba(230,168,23,0.1);  border-color: rgba(230,168,23,0.3);  color: #7a5300; }
.alert-info    { background: rgba(66,122,161,0.1);  border-color: rgba(66,122,161,0.3);  color: var(--rich-cerulean); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 16px 0 0; margin-top: 8px;
}
.pag-info { font-size: 13px; color: var(--text-muted); }
.pag-pages { display: flex; gap: 4px; }
.pag-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 8px;
  border-radius: 8px; font-size: 13px;
  color: var(--text-secondary); background: var(--white);
  border: 1px solid var(--border-light);
  transition: all var(--transition);
}
.pag-btn:hover { background: var(--alice-blue); color: var(--baltic-blue); border-color: var(--baltic-blue); }
.pag-btn.active { background: var(--baltic-blue); color: white; border-color: var(--baltic-blue); }
.pag-ellipsis { display: flex; align-items: center; padding: 0 6px; color: var(--text-muted); }

/* ── Search & Filters ─────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.search-box {
  position: relative; flex: 1; min-width: 200px;
}
.search-box i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted);
}
.search-box .form-control { padding-left: 38px; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden; transition: all var(--transition);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--white); border-radius: 16px;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow: auto;
  transform: scale(0.95); transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: 'Teko',sans-serif; font-size: 24px; }
.modal-close { background: none; border: none; color: var(--text-muted); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--alice-blue); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── License Key Display ──────────────────────────────────── */
.license-key-display {
  display: flex; align-items: center; gap: 12px;
  background: var(--alice-blue); border: 2px dashed var(--rich-cerulean);
  border-radius: 10px; padding: 14px 18px;
}
.lk-value {
  font-family: 'Courier New', monospace;
  font-size: 17px; font-weight: 700;
  color: var(--baltic-blue); letter-spacing: 2px;
  flex: 1; word-break: break-all;
}
.lk-copy {
  background: var(--baltic-blue); color: white;
  border: none; border-radius: 6px; padding: 6px 12px;
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: background var(--transition);
}
.lk-copy:hover { background: #044f6a; }

/* ── Progress & Status ────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--border-light); border-radius: 4px;
  height: 6px; overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--baltic-blue), var(--lime-moss));
  transition: width 0.6s ease;
}

/* Expiry indicator */
.expiry-good     { color: var(--sage-green); }
.expiry-warning  { color: var(--warning); }
.expiry-critical { color: var(--danger); font-weight: 600; }
.expiry-expired  { color: var(--danger); text-decoration: line-through; }
.expiry-lifetime { color: var(--rich-cerulean); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
}
.empty-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--alice-blue);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; color: var(--text-muted);
}
.empty-icon svg { width: 32px; height: 32px; }
.empty-state h3 {
  font-family: 'Teko', sans-serif;
  font-size: 24px; color: var(--text-secondary); margin-bottom: 8px;
}
.empty-state p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-nav {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 20px;
  background: none; border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px; color: var(--text-muted);
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
}
.tab-btn:hover { color: var(--baltic-blue); }
.tab-btn.active { color: var(--baltic-blue); border-bottom-color: var(--baltic-blue); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Section Dividers ─────────────────────────────────────── */
.section-heading {
  font-family: 'Teko', sans-serif;
  font-size: 18px; font-weight: 500;
  color: var(--text-secondary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #0d2744 50%, #05668d 100%);
  padding: 20px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 80%, rgba(5,102,141,0.3) 0%, transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(165,190,0,0.15) 0%, transparent 40%);
}
.login-card {
  background: rgba(255,255,255,0.97);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  width: 100%; max-width: 420px;
  overflow: hidden; position: relative; z-index: 1;
}
.login-header {
  background: linear-gradient(135deg, var(--sidebar-bg), var(--baltic-blue));
  padding: 36px 36px 30px;
  text-align: center;
}
.login-logo {
  width: 72px; height: 72px; border-radius: 18px;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.login-header h1 {
  font-family: 'Teko', sans-serif;
  font-size: 34px; color: white; font-weight: 600; letter-spacing: 1px;
}
.login-header p { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 4px; }
.login-body { padding: 32px 36px; }
.login-body .form-label { font-weight: 600; }
.login-footer {
  padding: 16px 36px 24px;
  text-align: center; font-size: 12px; color: var(--text-muted);
}

/* ── Dashboard Charts area ────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* Recent activity list */
.activity-list { list-style: none; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.activity-dot.dot-success { background: rgba(103,148,54,0.12); color: var(--sage-green); }
.activity-dot.dot-info    { background: rgba(5,102,141,0.1);   color: var(--baltic-blue); }
.activity-dot.dot-warning { background: rgba(230,168,23,0.12); color: var(--warning); }
.activity-dot.dot-danger  { background: rgba(217,79,61,0.1);   color: var(--danger); }
.activity-text { flex: 1; }
.activity-action { font-size: 13px; color: var(--text-primary); }
.activity-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1000;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-close { display: flex; }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .page-content { padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .login-body { padding: 24px 24px; }
  .login-header { padding: 28px 24px; }
  .login-footer { padding: 12px 24px 20px; }
  .topbar-clock { display: none; }
  .user-info { display: none; }
}

/* ── Utility ──────────────────────────────────────────────── */
.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--sage-green) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-info      { color: var(--rich-cerulean) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.fw-500         { font-weight: 500; }
.fw-600         { font-weight: 600; }
.mono           { font-family: 'Courier New', monospace; }
.d-flex         { display: flex; }
.align-center   { align-items: center; }
.gap-8          { gap: 8px; }
.gap-12         { gap: 12px; }
.mb-0           { margin-bottom: 0; }
.mb-16          { margin-bottom: 16px; }
.mb-24          { margin-bottom: 24px; }
.mt-16          { margin-top: 16px; }
.ms-auto        { margin-left: auto; }
.w-100          { width: 100%; }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Collapsed sidebar state */
.app-wrapper.sidebar-collapsed .sidebar { width: 60px; }
.app-wrapper.sidebar-collapsed .main-content { margin-left: 60px; }
.app-wrapper.sidebar-collapsed .nav-label,
.app-wrapper.sidebar-collapsed .nav-group-label,
.app-wrapper.sidebar-collapsed .logo-text,
.app-wrapper.sidebar-collapsed .sidebar-footer .sf-info,
.app-wrapper.sidebar-collapsed .sidebar-footer .sf-logout { display: none; }
.app-wrapper.sidebar-collapsed .nav-item { justify-content: center; padding: 12px; }
.app-wrapper.sidebar-collapsed .logo-link { justify-content: center; }

/* Loading spinner */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid rgba(5,102,141,0.2);
  border-top-color: var(--baltic-blue);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fade-in animation for page content */
.page-content { animation: fadeInUp 0.35s ease; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
