/* =========================================================
   KaamBook - Modern, Clean & Professional Design System
   "Apni Dukaan. Ab Smart."
   ========================================================= */

:root {
  /* Brand Colors */
  --kb-primary: #1d4ed8;
  --kb-primary-hover: #1e40af;
  --kb-primary-subtle: #eff6ff;
  --kb-primary-border: #bfdbfe;
  
  --kb-success: #059669;
  --kb-success-subtle: #ecfdf5;
  --kb-success-border: #a7f3d0;

  --kb-danger: #e11d48;
  --kb-danger-subtle: #fff1f2;
  --kb-danger-border: #fecdd3;

  --kb-warning: #d97706;
  --kb-warning-subtle: #fffbeb;
  --kb-warning-border: #fde68a;

  --kb-info: #0284c7;
  --kb-info-subtle: #f0f9ff;
  --kb-info-border: #bae6fd;

  --kb-dark: #0f172a;
  --kb-gray-800: #1e293b;
  --kb-gray-700: #334155;
  --kb-gray-600: #475569;
  --kb-gray-500: #64748b;
  --kb-gray-400: #94a3b8;
  --kb-gray-200: #e2e8f0;
  --kb-gray-100: #f1f5f9;
  --kb-gray-50: #f8fafc;

  /* Elevation Shadows */
  --kb-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --kb-shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --kb-shadow-md: 0 6px 12px -2px rgba(15, 23, 42, 0.08), 0 3px 6px -3px rgba(15, 23, 42, 0.05);
  --kb-shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.1), 0 4px 8px -4px rgba(15, 23, 42, 0.06);

  /* Borders & Radius */
  --kb-radius-sm: 8px;
  --kb-radius-md: 12px;
  --kb-radius-lg: 16px;
  --kb-radius-xl: 20px;
  --kb-radius-full: 9999px;
}

/* Global resets & typography */
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--kb-gray-50);
  color: var(--kb-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  padding-bottom: 74px; /* clearance for mobile bar */
}

@media (min-width: 992px) {
  body {
    padding-bottom: 24px;
  }
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--kb-radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Cards & Surfaces */
.kb-card {
  background: #ffffff;
  border-radius: var(--kb-radius-lg);
  border: 1px solid var(--kb-gray-200);
  box-shadow: var(--kb-shadow-sm);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.kb-card-interactive {
  cursor: pointer;
}
.kb-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--kb-shadow-lg);
  border-color: var(--kb-primary-border);
}

/* Typography & Money Formatting */
.kb-money {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Modern Badges */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.65rem;
}

.badge-paid {
  background-color: var(--kb-success-subtle);
  color: var(--kb-success);
  border: 1px solid var(--kb-success-border);
}

.badge-due {
  background-color: var(--kb-danger-subtle);
  color: var(--kb-danger);
  border: 1px solid var(--kb-danger-border);
}

.badge-partial {
  background-color: var(--kb-warning-subtle);
  color: var(--kb-warning);
  border: 1px solid var(--kb-warning-border);
}

/* Quick Demo Bar */
.kb-demo-bar {
  background: #090d16;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 0;
  color: #94a3b8;
}

.kb-demo-btn {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--kb-radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kb-demo-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Main Navbar */
.kb-navbar {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  box-shadow: 0 2px 10px -2px rgba(30, 58, 138, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 52px;
}

.kb-store-pill {
  height: 32px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-size: 0.78rem;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease-in-out;
}

.kb-nav-link {
  font-size: 0.80rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88) !important;
  padding: 0 0.65rem !important;
  border-radius: var(--kb-radius-full);
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  white-space: nowrap !important;
  height: 32px;
  line-height: 1;
}

.kb-nav-link i {
  font-size: 0.88rem;
  margin-right: 0.35rem;
}

.kb-nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.14);
}

.kb-nav-link.active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.kb-btn-newbill {
  height: 32px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.85rem;
  border-radius: var(--kb-radius-full);
}

.kb-user-pill {
  height: 32px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.75rem;
  border-radius: var(--kb-radius-full);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.kb-user-pill:hover, .kb-user-pill:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

/* Responsive Navbar Polishing */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--kb-radius-lg);
    padding: 1rem;
    margin-top: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
  }

  .kb-nav-link {
    display: flex;
    width: 100%;
    padding: 0.55rem 0.85rem !important;
    border-radius: var(--kb-radius-md);
    margin-bottom: 2px;
    font-size: 0.88rem;
    height: auto;
  }

  .kb-nav-link:hover, .kb-nav-link.active {
    background: rgba(255, 255, 255, 0.14);
  }
}

/* Quick Action Tiles */
.kb-quick-tile {
  background: #ffffff;
  border: 1px solid var(--kb-gray-200);
  border-radius: var(--kb-radius-md);
  padding: 12px 8px;
  text-align: center;
  transition: all 0.18s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--kb-dark);
}

.kb-quick-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--kb-shadow-md);
  border-color: var(--kb-primary-border);
  color: var(--kb-primary);
}

.kb-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--kb-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 6px;
}

/* Touch POS Cards */
.pos-prod-card {
  transition: transform 0.15s ease-in-out;
}

.pos-prod-card:active {
  transform: scale(0.97);
}

/* Forms & Inputs */
.form-control, .form-select {
  border: 1px solid #cbd5e1;
  padding: 0.55rem 0.85rem;
  font-size: 0.92rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
  border-color: var(--kb-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Mobile Bottom Navigation */
.kb-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--kb-gray-200);
  display: flex;
  justify-content: space-around;
  padding: 6px 0;
  z-index: 1040;
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

.kb-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--kb-gray-500);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  transition: color 0.15s;
  padding: 4px 12px;
}

.kb-bottom-nav-item i {
  font-size: 1.28rem;
  margin-bottom: 2px;
}

.kb-bottom-nav-item.active, .kb-bottom-nav-item:hover {
  color: var(--kb-primary);
}

.kb-bottom-nav-action {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white !important;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transition: transform 0.15s;
}

.kb-bottom-nav-action:active {
  transform: scale(0.92);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.kb-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Responsive Table */
.table th {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--kb-gray-600);
  border-bottom-width: 1px;
}

.table td {
  font-size: 0.88rem;
  vertical-align: middle;
}


/* =========================================================
   Super Admin Layout Styles
   ========================================================= */

/* Card Styles */
.kb-card {
    background: white;
    border-radius: var(--kb-radius-md, 12px);
    box-shadow: var(--kb-shadow-sm, 0 2px 4px rgba(0, 0, 0, 0.06));
    border: 1px solid var(--kb-gray-200, #e2e8f0);
}

/* Shortcut Cards Styles */
.kb-shortcut-card {
    display: block;
    transition: all 0.3s ease;
    text-decoration: none;
}

.kb-shortcut-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.kb-shortcut-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.kb-shortcut-card:hover .kb-shortcut-hover i {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* Purple Color Utility */
.text-purple {
    color: #9333ea !important;
}

.bg-purple {
    background-color: #9333ea !important;
}

.border-purple {
    border-color: #9333ea !important;
}

/* Fade In Animation */
.kb-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
