/* =====================================================================
   Shikza Pro360 — Custom theme on top of Bootstrap 5.3
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bs-primary: #4F46E5;          /* indigo */
  --bs-primary-rgb: 79, 70, 229;
  --shikza-primary: #4F46E5;
  --shikza-primary-dark: #4338CA;
  --shikza-primary-light: #eef2ff;
  --sidebar-bg: #1b1b29;
  --sidebar-bg2: #232336;
  --sidebar-text: #c7cad9;
  --sidebar-muted: #7c7f95;
  --sidebar-active: #4F46E5;
  --sidebar-width: 256px;
  --topbar-height: 64px;
  --body-bg: #f3f4fa;
  --card-border: #eceef4;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .06), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 28px rgba(16, 24, 40, .10);
}

/* ---------------------------------------------------------------------
   Base
   ------------------------------------------------------------------- */
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background-color: var(--body-bg);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #2b2d3a;
  letter-spacing: -.01em;
}
h1, h2, h3, h4, h5, h6, .fw-bold, .fw-semibold { letter-spacing: -.02em; }

a { color: var(--shikza-primary); text-decoration-thickness: 1px; }
a:hover { color: var(--shikza-primary-dark); }

/* ---------------------------------------------------------------------
   Primary colour overrides
   ------------------------------------------------------------------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: .55rem;
  transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  --bs-btn-bg: var(--shikza-primary);
  --bs-btn-border-color: var(--shikza-primary);
  --bs-btn-hover-bg: var(--shikza-primary-dark);
  --bs-btn-hover-border-color: var(--shikza-primary-dark);
  --bs-btn-active-bg: var(--shikza-primary-dark);
  --bs-btn-active-border-color: var(--shikza-primary-dark);
  --bs-btn-disabled-bg: var(--shikza-primary);
  --bs-btn-disabled-border-color: var(--shikza-primary);
  box-shadow: 0 2px 6px rgba(var(--bs-primary-rgb), .25);
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), .35); }
.btn-outline-primary {
  --bs-btn-color: var(--shikza-primary);
  --bs-btn-border-color: #c7c9f5;
  --bs-btn-hover-bg: var(--shikza-primary);
  --bs-btn-hover-border-color: var(--shikza-primary);
  --bs-btn-active-bg: var(--shikza-primary);
}
.btn-sm { --bs-btn-border-radius: .45rem; }
.btn-lg { --bs-btn-border-radius: .65rem; }

.link-primary, .text-decoration-none.text-primary { color: var(--shikza-primary) !important; }

.form-control, .form-select {
  border-radius: .55rem;
  border-color: #e2e4ee;
  padding-top: .5rem; padding-bottom: .5rem;
}
.form-control:focus, .form-select:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 .22rem rgba(var(--bs-primary-rgb), .14);
}
.form-label { margin-bottom: .35rem; color: #3a3c4a; }
.input-group-text { border-color: #e2e4ee; }
.form-check-input:checked { background-color: var(--shikza-primary); border-color: var(--shikza-primary); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(var(--bs-primary-rgb), .14); border-color: #a5b4fc; }

.page-link { color: var(--shikza-primary); border-radius: .45rem !important; margin: 0 2px; border-color: #e7e9f2; }
.page-item.active .page-link { background-color: var(--shikza-primary); border-color: var(--shikza-primary); }
.pagination { gap: 2px; }

/* ---------------------------------------------------------------------
   Auth pages
   ------------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 80% -10%, #6366f1 0%, transparent 50%),
              linear-gradient(135deg, #4F46E5 0%, #1b1b29 100%);
}
.auth-logo {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  font-size: 2.1rem; color: #fff;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.auth-page .card { border-radius: 1.1rem; }
.auth-logo.auth-logo-img {
  background: #fff;
  padding: 8px;
  overflow: hidden;
}
.auth-logo.auth-logo-img img {
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ---------------------------------------------------------------------
   App shell
   ------------------------------------------------------------------- */
.app-wrapper { display: flex; min-height: 100vh; }
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-left: var(--sidebar-width);
}
@media (max-width: 991.98px) { .app-main { margin-left: 0; } }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg2) 0%, var(--sidebar-bg) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .sidebar.offcanvas-lg {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: none;
    visibility: visible;
    z-index: 1030;
  }
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex; align-items: center; gap: .6rem;
  padding: 0 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-mark {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4F46E5);
  border-radius: 11px; color: #fff; font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), .4);
  flex-shrink: 0;
}
.brand-mark-logo {
  background: #fff;
  padding: 3px;
  overflow: hidden;
}
.brand-mark-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 7px;
}
.brand-name { color: #fff; font-weight: 800; font-size: 1.12rem; letter-spacing: -.03em; }

.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: .65rem .6rem !important; }
.sidebar-nav .nav-link {
  color: var(--sidebar-text);
  padding: .6rem .85rem;
  margin-bottom: 2px;
  display: flex; align-items: center; gap: .8rem;
  border-radius: .6rem;
  font-size: .9rem;
  font-weight: 500;
  position: relative;
  transition: background .15s, color .15s;
}
.sidebar-nav .nav-link i { font-size: 1.12rem; width: 22px; text-align: center; opacity: .85; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar-nav .nav-link:hover i { opacity: 1; }
.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(79,70,229,.9));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), .35);
}
.sidebar-nav .nav-link.active i { opacity: 1; }
.sidebar-nav .nav-link.active::before {
  content: ""; position: absolute; left: -.6rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: #fff; border-radius: 0 3px 3px 0;
}
/* sidebar scrollbar */
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: .55rem .85rem;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-footer .nav-link { padding: .4rem .5rem; display: flex; gap: .5rem; align-items: center; border-radius: .5rem; }
.sidebar-footer .nav-link:hover { background: rgba(255,255,255,.06); }
.sidebar-footer .nav-link.logout-link { color: #ff8095; }
.sidebar-footer .nav-link.logout-link:hover { color: #ff5c76; }
.version-tag { color: var(--sidebar-muted); font-size: .72rem; }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-height);
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(8px);
  display: flex; align-items: center; gap: .5rem;
  padding: 0 1.1rem;
  position: sticky; top: 0; z-index: 1020;
  border-bottom: 1px solid var(--card-border);
}
.topbar-title .fw-semibold { font-size: 1.05rem; }
.btn-light.btn-icon { background: #f3f4fa; border-color: transparent; color: #475067; }
.btn-light.btn-icon:hover { background: #e9ebf5; }
.btn-icon {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border-radius: .6rem;
}
.user-btn { border-radius: .6rem; background: #f3f4fa; border-color: transparent; }
.user-btn:hover { background: #e9ebf5; }
.avatar-circle {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4F46E5); color: #fff;
  border-radius: 50%; font-size: .78rem; font-weight: 700;
  overflow: hidden;
}
.branch-select { min-width: 160px; border-radius: .55rem; }
.dropdown-menu { border: 1px solid var(--card-border); border-radius: .7rem; box-shadow: var(--shadow-lg); padding: .35rem; }
.dropdown-item { border-radius: .5rem; padding: .5rem .7rem; font-size: .9rem; }
.dropdown-item:active { background: var(--shikza-primary); }

/* ---------------------------------------------------------------------
   Page content
   ------------------------------------------------------------------- */
.page-content { flex: 1 1 auto; }
.page-content > .container-fluid { animation: fadeInUp .35s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.app-footer { padding: 1rem 0 1.25rem; margin-top: auto; }

.page-header {
  display: flex; flex-wrap: wrap; gap: .75rem;
  align-items: center; justify-content: space-between;
  margin-bottom: 1.35rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 800; margin: 0; color: #1f2130; }
.page-header p { font-size: .9rem; }

/* ---------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------- */
.card {
  border-radius: .85rem;
  border: 1px solid var(--card-border);
}
.card.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.card.shadow { box-shadow: var(--shadow-md) !important; }
.card-header { background-color: #fff; border-bottom: 1px solid var(--card-border); padding: .9rem 1.1rem; font-size: .95rem; }
.card-header.bg-white { border-top-left-radius: .85rem; border-top-right-radius: .85rem; }

/* clickable stat / report cards lift on hover */
a .stat-card, a.text-reset .card, .report-card { transition: transform .14s ease, box-shadow .14s ease; }
a:hover .stat-card, a.text-reset:hover .card { transform: translateY(-3px); box-shadow: var(--shadow-md) !important; }

.icon-box {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: .8rem;
}
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.1; letter-spacing: -.03em; color: #1f2130; }
.stat-card .text-muted.small { font-weight: 500; }

/* ---------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------- */
.table { --bs-table-border-color: #eef0f6; margin-bottom: 0; }
.table > thead.table-light th {
  background: #f7f8fc;
  color: #6b7088;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid #eceef4;
  padding-top: .7rem; padding-bottom: .7rem;
}
.table > :not(caption) > * > * { vertical-align: middle; padding: .72rem .9rem; }
.table-hover > tbody > tr { transition: background .12s; }
.table-hover > tbody > tr:hover > * { background: rgba(var(--bs-primary-rgb), .035); }
.table-responsive { border-radius: .85rem; }

/* ---------------------------------------------------------------------
   Badges & pills
   ------------------------------------------------------------------- */
.badge { font-weight: 600; padding: .4em .65em; border-radius: .45rem; letter-spacing: .01em; }
.badge.rounded-pill { border-radius: 50rem; }

/* ---------------------------------------------------------------------
   Alerts / flash
   ------------------------------------------------------------------- */
.alert { border: 1px solid transparent; border-radius: .7rem; box-shadow: var(--shadow-sm); }
.alert-success { background: #e9f7ef; color: #146c43; border-color: #c3ead4; }
.alert-danger  { background: #fdecee; color: #b02a37; border-color: #f5c6cb; }
.alert-warning { background: #fff7e6; color: #8a6100; border-color: #ffe2a8; }
.alert-info    { background: #e8f1ff; color: #084298; border-color: #c5dcfb; }

/* ---------------------------------------------------------------------
   Nav pills (settings sub-nav etc.)
   ------------------------------------------------------------------- */
.nav-pills .nav-link { border-radius: .55rem; font-weight: 500; font-size: .9rem; padding: .45rem .85rem; }
.nav-pills .nav-link.active { background: var(--shikza-primary); box-shadow: 0 2px 8px rgba(var(--bs-primary-rgb), .3); }
.nav-tabs { border-bottom-color: var(--card-border); }
.nav-tabs .nav-link { border: none; color: #6b7088; font-weight: 600; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--shikza-primary); background: transparent; border-bottom-color: var(--shikza-primary); }

/* ---------------------------------------------------------------------
   Empty state
   ------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 3rem 1rem; color: #9aa0ad; }
.empty-state i { font-size: 2.6rem; opacity: .55; }
.empty-state p { font-weight: 500; }

/* ---------------------------------------------------------------------
   List groups & modals
   ------------------------------------------------------------------- */
.list-group-item { border-color: #f0f1f6; }
.list-group-item-action:hover { background: #f7f8fc; }
.modal-content { border: none; border-radius: .9rem; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--card-border); }
.modal-footer { border-top-color: var(--card-border); }

/* ---------------------------------------------------------------------
   Global scrollbar
   ------------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d3d6e3; border-radius: 6px; border: 2px solid var(--body-bg); }
::-webkit-scrollbar-thumb:hover { background: #b9bdcf; }

/* ---------------------------------------------------------------------
   Utilities
   ------------------------------------------------------------------- */
.cursor-pointer { cursor: pointer; }
.min-vh-100 { min-height: 100vh; }
.min-w-0 { min-width: 0; }
.toast { border-radius: .6rem; }
