/* =======================================================================
 * KBIS INDIA - PAN FINDER PORTAL
 * Material / Creative-Tim inspired Admin theme.
 * ===================================================================== */

:root {
  --theme-color: #6a1b9a;
  --theme-color-2: #8e24aa;
  --gradient-sidebar: linear-gradient(180deg, #8e24aa 0%, #6a1b9a 55%, #4a148c 100%);
  --gradient-purple: linear-gradient(135deg, #8e24aa, #d81b60);
  --gradient-green:  linear-gradient(135deg, #43a047, #66bb6a);
  --gradient-orange: linear-gradient(135deg, #fb8c00, #ffb300);
  --gradient-red:    linear-gradient(135deg, #e53935, #ef5350);
  --gradient-blue:   linear-gradient(135deg, #1e88e5, #42a5f5);
  --gradient-teal:   linear-gradient(135deg, #00897b, #26a69a);
  --gradient-pink:   linear-gradient(135deg, #ec407a, #f06292);

  --bg-body:   #f5f6fa;
  --surface:   #ffffff;
  --text-1:    #2e2e3a;
  --text-2:    #6c7293;
  --border:    #eef0f6;
  --radius:    18px;
  --shadow-sm: 0 4px 18px rgba(0,0,0,.06);
  --shadow-md: 0 10px 30px rgba(106,27,154,.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--text-1);
  font-size: 14px;
}

a { text-decoration: none; }

/* =======================================================================
 *  LAYOUT
 * ===================================================================== */

.kbis-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--gradient-sidebar);
  color: #fff;
  padding: 14px 12px;
  z-index: 1040;
  box-shadow: 5px 0 30px rgba(0,0,0,.12);
  transition: transform .3s ease;
  display: flex;
  flex-direction: column;
}

.kbis-sidebar::-webkit-scrollbar { width: 6px; }
.kbis-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

.kbis-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  margin-bottom: 10px;
  flex-shrink: 0;
}
.kbis-brand i {
  font-size: 28px;
  color: #fff;
  background: rgba(255,255,255,.18);
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
}
.kbis-brand img {
  width: 46px; height: 46px; border-radius: 12px; object-fit: cover;
  background: rgba(255,255,255,.1);
}
.kbis-brand-text span {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
}
.kbis-brand-text small {
  color: #ffeb3b;
  font-size: 11px;
  letter-spacing: 1px;
}

.kbis-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}
.kbis-menu::-webkit-scrollbar { width: 6px; }
.kbis-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 4px; }

.kbis-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,.85);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13.5px;
  transition: all .25s ease;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}
.kbis-link i { width: 18px; text-align: center; font-size: 14px; }

.kbis-link:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  transform: translateX(4px);
}
.kbis-link.active {
  background: #fff;
  color: var(--theme-color);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.kbis-link.active i { color: var(--theme-color); }

.kbis-logout { margin-top: 10px; background: rgba(255,255,255,.08); }

/* =======================================================================
 *  MAIN
 * ===================================================================== */

.kbis-main {
  margin-left: 260px;
  min-height: 100vh;
  padding: 20px 24px 40px;
  transition: margin-left .3s ease;
}

.kbis-topbar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
  position: sticky;
  top: 12px;
  z-index: 10;
  backdrop-filter: saturate(1.2) blur(6px);
}

.kbis-burger {
  display: none;
  background: transparent;
  border: 0;
  font-size: 20px;
  color: var(--theme-color);
}

.kbis-topbar-title { flex: 1; min-width: 0; }
.kbis-topbar-title h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
  color: var(--text-1);
}
.kbis-topbar-title small { font-size: 12px; }

.kbis-topbar-right {
  display: flex; align-items: center; gap: 12px;
}

.kbis-search {
  position: relative;
  background: #f1f3f9;
  border-radius: 12px;
  padding: 8px 12px;
  width: 240px;
  align-items: center;
  gap: 8px;
}
.kbis-search i { color: var(--text-2); }
.kbis-search input {
  background: transparent; border: 0; outline: 0; flex: 1;
  font-size: 13px;
}

.kbis-icon-btn {
  width: 42px; height: 42px; border-radius: 12px;
  background: #f1f3f9;
  color: var(--text-1);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: .2s;
}
.kbis-icon-btn:hover { background: var(--theme-color); color: #fff; }

.kbis-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #e53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(229,57,53,.4);
}

.kbis-profile {
  display: flex; align-items: center; gap: 10px;
  background: #f1f3f9;
  border: 0;
  padding: 6px 12px 6px 6px;
  border-radius: 14px;
  cursor: pointer;
  transition: .2s;
}
.kbis-profile:hover { background: #e8eaf6; }
.kbis-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gradient-purple);
  color: #fff; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.kbis-profile-name { font-weight: 600; font-size: 13px; line-height: 1.1; }

.kbis-content { }

/* =======================================================================
 *  CARDS
 * ===================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: .3s ease;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}
.stat-card::after {
  content: '';
  position: absolute;
  inset: auto -40px -40px auto;
  width: 120px; height: 120px;
  background: rgba(106,27,154,.05);
  border-radius: 50%;
}

.stat-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}
.bg-purple { background: var(--gradient-purple); }
.bg-green  { background: var(--gradient-green); }
.bg-orange { background: var(--gradient-orange); }
.bg-red    { background: var(--gradient-red); }
.bg-blue   { background: var(--gradient-blue); }
.bg-teal   { background: var(--gradient-teal); }
.bg-pink   { background: var(--gradient-pink); }

.stat-card h5 { color: var(--text-2); font-size: 13px; font-weight: 500; margin: 0 0 4px; }
.stat-card h2 { color: var(--text-1); font-size: 24px; font-weight: 700; margin: 0; }
.stat-card .trend {
  font-size: 12px; font-weight: 600; margin-top: 6px;
}
.trend.up   { color: #43a047; }
.trend.down { color: #e53935; }

/* =======================================================================
 *  PANELS / SECTIONS
 * ===================================================================== */

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; gap: 10px; flex-wrap: wrap;
}
.panel-header h3 {
  font-size: 16px; font-weight: 600; margin: 0;
  color: var(--text-1);
}
.panel-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =======================================================================
 *  TABLES
 * ===================================================================== */

.kbis-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.kbis-table th {
  background: #faf6fd;
  color: var(--theme-color);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.kbis-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-1);
}
.kbis-table tr:hover td { background: #fafbff; }

.table-scroll { overflow-x: auto; }

/* Status pills */
.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.pill-success { background: #e8f5e9; color: #2e7d32; }
.pill-danger  { background: #ffebee; color: #c62828; }
.pill-warn    { background: #fff8e1; color: #ef6c00; }
.pill-info    { background: #e3f2fd; color: #1565c0; }
.pill-muted   { background: #eceff1; color: #546e7a; }

/* =======================================================================
 *  FORMS / BUTTONS
 * ===================================================================== */

.form-label { font-weight: 500; font-size: 13px; color: var(--text-1); }

.form-control, .form-select {
  border-radius: 12px;
  border: 1px solid #e3e6ef;
  padding: 10px 14px;
  font-size: 14px;
  transition: .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--theme-color);
  box-shadow: 0 0 0 3px rgba(106,27,154,.15);
}

.btn { border-radius: 12px; font-weight: 500; padding: 10px 18px; transition: .25s; }
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--gradient-purple);
  border: 0;
  box-shadow: 0 6px 14px rgba(142,36,170,.3);
}
.btn-primary:hover {
  background: var(--gradient-purple);
  box-shadow: 0 10px 22px rgba(142,36,170,.4);
}
.btn-success {
  background: var(--gradient-green); border: 0;
  box-shadow: 0 6px 14px rgba(67,160,71,.3);
}
.btn-warning {
  background: var(--gradient-orange); border: 0; color: #fff;
  box-shadow: 0 6px 14px rgba(251,140,0,.3);
}
.btn-danger {
  background: var(--gradient-red); border: 0;
  box-shadow: 0 6px 14px rgba(229,57,53,.3);
}
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 10px; }

.btn-icon {
  width: 34px; height: 34px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 13px;
}

/* =======================================================================
 *  ALERTS
 * ===================================================================== */

.alert { border: 0; border-radius: 12px; font-weight: 500; font-size: 14px; }

/* =======================================================================
 *  CHART WRAPPER
 * ===================================================================== */

.chart-wrap { position: relative; height: 280px; }

/* =======================================================================
 *  LOGIN
 * ===================================================================== */

body.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(-45deg, #4a148c, #6a1b9a, #8e24aa, #ab47bc);
  background-size: 400% 400%;
  animation: gradientBG 12s ease infinite;
  position: relative; overflow: hidden;
}
@keyframes gradientBG {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.login-body .circle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.08); animation: float 7s ease-in-out infinite;
}
.login-body .circle:nth-child(1){ width:220px;height:220px;top:10%;left:8%; }
.login-body .circle:nth-child(2){ width:320px;height:320px;bottom:-60px;right:5%;animation-delay:2s; }
.login-body .circle:nth-child(3){ width:140px;height:140px;top:70%;left:22%;animation-delay:4s; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-25px)} }

.login-card {
  position: relative;
  z-index: 2;
  width: 420px;
  max-width: 92vw;
  padding: 38px 34px;
  border-radius: 24px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  color: #fff;
  animation: fadeIn .7s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(30px)} to{opacity:1;transform:translateY(0)} }

.login-card h1 {
  text-align: center; font-size: 30px; font-weight: 700; letter-spacing: .5px;
  margin: 0 0 4px;
}
.login-card h1 span { color: #ffeb3b; }
.login-card .sub {
  text-align: center; font-size: 12.5px; letter-spacing: 2px; color: #e1bee7;
  margin-bottom: 28px;
}

.login-card .form-control {
  background: rgba(255,255,255,.18);
  border: 0; color: #fff;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
}
.login-card .form-control::placeholder { color: #e1bee7; }
.login-card .form-control:focus {
  background: rgba(255,255,255,.26);
  box-shadow: 0 0 0 3px rgba(255,255,255,.2);
}

.login-card .btn-login {
  width: 100%;
  background: #fff;
  color: var(--theme-color);
  font-weight: 700;
  padding: 14px;
  border-radius: 14px;
  border: 0;
  letter-spacing: 1px;
  transition: .25s;
}
.login-card .btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,.25);
}

.login-footer {
  margin-top: 22px; text-align: center; font-size: 12px; color: #e1bee7;
  letter-spacing: 1px;
}

/* =======================================================================
 *  RESPONSIVE
 * ===================================================================== */

.kbis-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0; pointer-events: none;
  transition: .3s;
  z-index: 1039;
}
body.kbis-open .kbis-backdrop { opacity: 1; pointer-events: auto; }

@media (max-width: 992px) {
  .kbis-sidebar { transform: translateX(-100%); }
  body.kbis-open .kbis-sidebar { transform: translateX(0); }
  .kbis-main { margin-left: 0; padding: 12px 14px 40px; }
  .kbis-burger { display: inline-flex; }
  .kbis-topbar { top: 0; border-radius: 14px; }
}

@media (max-width: 576px) {
  .kbis-topbar-title h1 { font-size: 16px; }
  .kbis-search { display: none !important; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-card h2 { font-size: 20px; }
}

/* Loader */
.kbis-loader {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.7);
  display: none; align-items: center; justify-content: center;
  z-index: 2000;
}
.kbis-loader.show { display: flex; }
.kbis-loader .spin {
  width: 50px; height: 50px;
  border: 4px solid #e1bee7;
  border-top-color: var(--theme-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Marquee notice */
.kbis-notice {
  background: linear-gradient(90deg, #fff3cd, #fff8e1);
  border-left: 4px solid #ffb300;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  color: #7c5700;
  margin-bottom: 18px;
  overflow: hidden;
}
.kbis-notice i { color: #ffb300; margin-right: 8px; }
