/* ===================================================================
   BUSINESS DETAILS PAGE — SUPER ADMIN
   =================================================================== */
*{box-sizing:border-box;margin:0;padding:0}
body{
  font-family:Inter,Segoe UI,Arial,sans-serif;
  background:#f4f7fb;color:#182033;font-size:13px;
  -webkit-font-smoothing:antialiased;
}
:root{
  --navy:#172554;--purple:#7c3aed;--blue:#2563eb;--green:#16a34a;
  --orange:#f97316;--pink:#db2777;--red:#dc2626;
  --border:#e5e7eb;--muted:#64748b;
}

/* ---------------------- LAYOUT ---------------------- */
.layout{display:flex;min-height:100vh}

/* SIDEBAR */
.sidebar{
  width:255px;background:var(--navy);color:#fff;
  position:fixed;left:0;top:0;bottom:0;
  padding:22px 14px;overflow-y:auto;z-index:10;
}
.brand{
  font-size:17px;font-weight:900;line-height:1.2;
  padding:6px 10px 20px;
  border-bottom:1px solid #33447a;margin-bottom:6px;
}
.brand span{
  display:block;color:#67e8f9;font-size:10px;
  margin-top:6px;letter-spacing:1px;font-weight:800;
}
.nav-title{
  font-size:10px;font-weight:800;color:#93a4d1;
  margin:18px 10px 8px;letter-spacing:1.2px;text-transform:uppercase;
}
.nav{display:flex;flex-direction:column;gap:2px}
.nav a{
  display:flex;align-items:center;gap:10px;
  padding:9px 12px;margin:2px 0;border-radius:9px;
  color:#dbe5ff;text-decoration:none;
  font-size:13px;font-weight:650;transition:all .15s ease;
}
.nav a:hover{background:#263a7a;color:#fff}
.nav a.active{
  background:var(--purple);color:#fff;font-weight:800;
  box-shadow:0 4px 12px rgba(124,58,237,.35);
}
.icon{
  width:25px;height:25px;display:grid;place-items:center;
  border-radius:7px;background:#33447a;font-size:13px;
  font-style:normal;flex-shrink:0;
}
.active .icon{background:#5b21b6}

/* MAIN */
.main{margin-left:255px;width:calc(100% - 255px);min-width:0}

/* TOPBAR */
.topbar{
  height:70px;background:#fff;border-bottom:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;
  padding:0 28px;position:sticky;top:0;z-index:5;gap:16px;
}
.search{
  width:430px;max-width:50%;
  border:1px solid #dbe1ea;border-radius:9px;
  padding:11px 14px;font-size:13px;outline:none;
}
.search:focus{border-color:var(--purple);box-shadow:0 0 0 3px rgba(124,58,237,.1)}
.topbar-right{display:flex;align-items:center;gap:14px}

.notif-btn{
  position:relative;background:#f3f4f6;border:0;
  width:38px;height:38px;border-radius:9px;
  font-size:16px;cursor:pointer;display:grid;place-items:center;
}
.notif-btn:hover{background:#e5e7eb}
.notif-badge{
  position:absolute;top:-4px;right:-4px;
  background:var(--red);color:#fff;font-size:9px;font-weight:900;
  min-width:16px;height:16px;border-radius:8px;
  display:grid;place-items:center;padding:0 4px;
  border:2px solid #fff;
}
.user{display:flex;align-items:center;gap:10px;cursor:pointer}
.user-info{text-align:right;font-size:12px;line-height:1.3}
.user-info b{display:block;font-weight:800;color:#111827}
.user-info small{color:var(--muted);font-size:10px}
.avatar{
  width:38px;height:38px;border-radius:9px;
  background:var(--purple);color:#fff;
  display:grid;place-items:center;font-weight:900;font-size:13px;
}
.logout-btn{
  display:inline-flex;align-items:center;gap:6px;
  background:#fef2f2;color:var(--red);
  border:1px solid #fecaca;border-radius:8px;
  padding:8px 14px;font-size:11px;font-weight:800;
  cursor:pointer;transition:all .2s ease;
}
.logout-btn:hover{background:var(--red);color:#fff;border-color:var(--red)}

/* CONTENT */
.content{padding:24px 28px 40px}

/* PAGE HEAD */
.page-head{
  display:flex;align-items:flex-start;justify-content:space-between;
  margin-bottom:20px;gap:16px;
}
.page-head h1{font-size:26px;font-weight:900;color:#111827}
.page-head p{font-size:12px;color:var(--muted);margin-top:5px}
.page-actions{display:flex;gap:8px;flex-shrink:0}

/* BUTTONS */
.btn{
  border:0;border-radius:8px;padding:10px 16px;
  font-weight:800;font-size:12px;cursor:pointer;
  transition:all .15s ease;
}
.btn.primary{background:var(--purple);color:#fff}
.btn.primary:hover{background:#6d28d9}
.btn.ghost{background:#eef2f7;color:#334155}
.btn.ghost:hover{background:#e2e8f0}

/* ---------------------- KPI CARDS ---------------------- */
.kpi-row{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));
  gap:14px;margin-bottom:20px;
}
.kpi-card{
  background:#fff;border:1.5px solid transparent;
  border-radius:14px;padding:16px;
  display:flex;align-items:center;gap:14px;
  box-shadow:0 4px 14px rgba(0,0,0,.035);
  transition:transform .2s ease,box-shadow .2s ease;
}
.kpi-card:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(0,0,0,.08)}
.kpi-icon{
  width:48px;height:48px;border-radius:12px;
  display:grid;place-items:center;flex-shrink:0;
}
.kpi-body{flex:1;min-width:0}
.kpi-label{
  font-size:10px;font-weight:800;color:#1e293b;
  text-transform:uppercase;letter-spacing:.4px;margin-bottom:4px;
}
.kpi-value{
  font-size:24px;font-weight:900;line-height:1.1;letter-spacing:-.5px;
}
.kpi-sub{font-size:10px;color:var(--muted);margin-top:3px;font-weight:600}

.kpi-blue{border-color:#dbeafe;background:linear-gradient(180deg,#fff 70%,#eff6ff)}
.kpi-blue .kpi-icon{background:#dbeafe;color:var(--blue)}
.kpi-blue .kpi-value{color:var(--blue)}

.kpi-green{border-color:#bbf7d0;background:linear-gradient(180deg,#fff 70%,#f0fdf4)}
.kpi-green .kpi-icon{background:#dcfce7;color:var(--green)}
.kpi-green .kpi-value{color:var(--green)}

.kpi-orange{border-color:#fed7aa;background:linear-gradient(180deg,#fff 70%,#fff7ed)}
.kpi-orange .kpi-icon{background:#ffedd5;color:#ea580c}
.kpi-orange .kpi-value{color:#ea580c}

.kpi-purple{border-color:#ddd6fe;background:linear-gradient(180deg,#fff 70%,#f5f3ff)}
.kpi-purple .kpi-icon{background:#ede9fe;color:var(--purple)}
.kpi-purple .kpi-value{color:var(--purple)}

/* ---------------------- MAIN GRID ---------------------- */
.main-grid{
  display:grid;grid-template-columns:1fr 420px;
  gap:20px;align-items:flex-start;
}
.left-col{min-width:0}
.right-col{position:sticky;top:90px}

/* ---------------------- FILTERS ---------------------- */
.filters-bar{
  background:#fff;border:1px solid var(--border);
  border-radius:12px;padding:14px;
  display:grid;grid-template-columns:2fr 1fr 1fr 1fr auto auto;
  gap:10px;margin-bottom:18px;align-items:center;
}
.filter-search{
  border:1px solid #d7dee9;border-radius:8px;
  padding:9px 12px;font-size:12px;outline:none;width:100%;
}
.filter-search:focus{border-color:var(--purple);box-shadow:0 0 0 3px rgba(124,58,237,.08)}
.filter-select{
  border:1px solid #d7dee9;border-radius:8px;
  padding:9px 10px;font-size:12px;background:#fff;
  outline:none;cursor:pointer;
}
.filter-select:focus{border-color:var(--purple)}

/* ---------------------- PANEL ---------------------- */
.panel{
  background:#fff;border:1px solid var(--border);
  border-radius:12px;padding:18px;
}
.panel-head{
  display:flex;justify-content:space-between;
  align-items:center;margin-bottom:14px;
}
.panel-head h2{font-size:16px;font-weight:900;color:#111827}
.panel-head h2 span{color:var(--purple)}

/* TABLE */
.table-wrap{overflow-x:auto;margin:0 -6px;padding:0 6px}
.biz-table{
  width:100%;border-collapse:collapse;
  font-size:12px;min-width:880px;
}
.biz-table th{
  background:#f8fafc;color:#475569;
  text-align:left;padding:11px 10px;
  font-size:10px;font-weight:800;
  text-transform:uppercase;letter-spacing:.4px;
  border-bottom:1px solid #e5e7eb;white-space:nowrap;
}
.biz-table td{
  padding:12px 10px;border-bottom:1px solid #f1f5f9;
  color:#334155;font-weight:600;vertical-align:middle;
}
.biz-table tbody tr:hover{background:#f8fafc;cursor:pointer}
.biz-table tbody tr.selected{background:#f5f3ff}

.biz-name-cell{
  display:flex;align-items:center;gap:10px;
  font-weight:800;color:#111827;
}
.biz-logo{
  width:32px;height:32px;border-radius:8px;
  display:grid;place-items:center;font-size:16px;flex-shrink:0;
  background:#eef2ff;
}
.biz-logo.logo-1{background:#dbeafe;color:#2563eb}
.biz-logo.logo-2{background:#fff7ed;color:#ea580c}
.biz-logo.logo-3{background:#ecfdf5;color:#16a34a}
.biz-logo.logo-4{background:#fef3c7;color:#d97706}
.biz-logo.logo-5{background:#fee2e2;color:#dc2626}
.biz-logo.logo-6{background:#ede9fe;color:#7c3aed}
.biz-logo.logo-7{background:#fff1f2;color:#e11d48}
.biz-logo.logo-8{background:#e0e7ff;color:#4338ca}
.biz-logo.logo-9{background:#cffafe;color:#0891b2}

.city-cell{line-height:1.35}
.city-cell small{
  color:var(--muted);font-weight:600;
  font-size:10px;display:block;margin-top:2px;
}

.status-pill{
  display:inline-flex;align-items:center;gap:5px;
  padding:5px 10px;border-radius:20px;
  font-size:10px;font-weight:800;
}
.status-pill::before{
  content:'';width:6px;height:6px;border-radius:50%;
}
.status-pill.active{background:#dcfce7;color:#166534}
.status-pill.active::before{background:#16a34a}
.status-pill.inactive{background:#fef3c7;color:#92400e}
.status-pill.inactive::before{background:#f59e0b}

.action-cell{display:flex;align-items:center;gap:6px;white-space:nowrap}
.btn-view{
  display:inline-flex;align-items:center;gap:4px;
  background:#eef2ff;color:#4338ca;border:0;
  border-radius:6px;padding:6px 10px;
  font-size:11px;font-weight:800;cursor:pointer;
  transition:all .15s ease;
}
.btn-view:hover{background:#c7d2fe}
.btn-more{
  background:#f1f5f9;border:0;border-radius:6px;
  width:26px;height:26px;display:grid;place-items:center;
  font-size:14px;cursor:pointer;color:#64748b;
}
.btn-more:hover{background:#e2e8f0;color:#334155}

/* PAGINATION */
.pagination-row{
  display:flex;justify-content:space-between;align-items:center;
  margin-top:16px;padding-top:14px;
  border-top:1px solid #f1f5f9;
  font-size:11px;color:var(--muted);font-weight:700;
}
.pages{display:inline-flex;gap:5px}
.pages button{
  border:1px solid #cfd9e6;background:#fff;
  color:#1e293b;border-radius:7px;
  padding:5px 10px;font-size:11px;font-weight:800;
  cursor:pointer;min-width:30px;height:30px;
  display:inline-flex;align-items:center;justify-content:center;
}
.pages button:hover:not([disabled]){background:#e0e7ff;color:#3730a3}
.pages button.current{
  background:var(--purple);color:#fff;border-color:var(--purple);
}
.pages button:disabled{opacity:.4;cursor:not-allowed}

/* ---------------------- RIGHT PANEL ---------------------- */
.profile-panel{
  background:#fff;border:1px solid var(--border);
  border-radius:12px;padding:20px;position:relative;
}
.close-panel-btn{
  position:absolute;top:14px;right:14px;
  width:26px;height:26px;border-radius:50%;
  background:#f1f5f9;border:0;cursor:pointer;
  display:grid;place-items:center;
  font-size:12px;color:#64748b;font-weight:800;
}
.close-panel-btn:hover{background:#e2e8f0;color:#334155}

/* PROFILE HEADER */
.profile-header{
  display:flex;gap:14px;align-items:flex-start;
  padding-bottom:16px;border-bottom:1px solid #f1f5f9;
}
.profile-avatar{
  width:56px;height:56px;border-radius:12px;
  background:#dbeafe;color:#2563eb;
  display:grid;place-items:center;flex-shrink:0;
}
.profile-head-info{flex:1;min-width:0;padding-right:20px}
.profile-head-info h3{
  font-size:17px;font-weight:900;color:#111827;
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
}
.profile-cat{font-size:11px;color:var(--muted);font-weight:700;margin-top:3px}
.profile-meta{
  display:flex;gap:14px;flex-wrap:wrap;
  font-size:10px;color:var(--muted);margin-top:8px;font-weight:600;
}
.profile-meta b{color:#334155;font-weight:800}

/* TABS */
.profile-tabs{
  display:flex;gap:0;margin:16px 0 18px;
  border-bottom:1px solid #f1f5f9;overflow-x:auto;
}
.tab{
  background:transparent;border:0;
  padding:10px 12px;font-size:11px;font-weight:800;
  color:#64748b;cursor:pointer;white-space:nowrap;
  border-bottom:2px solid transparent;
  transition:all .15s ease;
}
.tab:hover{color:var(--purple)}
.tab.active{color:var(--purple);border-bottom-color:var(--purple)}

.profile-tab-panel{display:none}
.profile-tab-panel.active{display:block}
.tab-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 12px}
.tab-summary-card{min-width:0;padding:10px 9px;border:1px solid #e9edf4;border-radius:9px;background:#fbfcfe}
.tab-summary-label{font-size:9px;font-weight:800;color:#748095;text-transform:uppercase;line-height:1.3}
.tab-summary-value{font-size:16px;font-weight:900;color:#172033;margin-top:5px;overflow-wrap:anywhere}
.tab-search,.tab-filter{
  border:1px solid #d7dee9;border-radius:8px;background:#fff;
  padding:8px 10px;font:inherit;font-size:11px;color:#334155;
}
.tab-search{width:100%;margin:0 0 12px}
.tab-filter{max-width:150px}
.tab-record-count{font-size:10px;font-weight:700;color:var(--muted)}
.tab-table-wrap{width:100%;overflow:auto;border:1px solid var(--border);border-radius:8px}
.tab-table{width:100%;min-width:560px;border-collapse:collapse;font-size:10px;text-align:left}
.tab-table th{padding:9px 8px;background:#f8fafc;color:#64748b;font-size:9px;text-transform:uppercase;white-space:nowrap}
.tab-table td{padding:9px 8px;border-top:1px solid #f1f5f9;color:#334155;vertical-align:top}
.tab-table .tab-loading{text-align:center;padding:22px;color:var(--muted)}
.tab-table .tab-empty{text-align:center;padding:22px;color:var(--muted)}
.tab-table .tab-id{font-weight:800;color:#4338ca;white-space:nowrap}
.tab-table .tab-amount{font-weight:800;color:#111827;white-space:nowrap}
.tab-status{display:inline-block;border-radius:12px;padding:4px 7px;font-size:9px;font-weight:800;background:#e2e8f0;color:#475569;white-space:nowrap}
.tab-status.completed{background:#dcfce7;color:#166534}
.tab-status.pending{background:#fef3c7;color:#92400e}
.tab-status.failed,.tab-status.refunded{background:#fee2e2;color:#991b1b}
.tab-activity-item{display:flex;gap:10px;padding:11px 0;border-bottom:1px solid #edf0f5}
.tab-activity-item:last-child{border-bottom:0}
.tab-activity-icon{width:30px;height:30px;border-radius:9px;display:grid;place-items:center;background:#eef2ff;color:#4338ca;flex:0 0 30px;font-weight:800}
.tab-activity-title{font-size:11px;font-weight:800;color:#1e293b}
.tab-activity-meta{font-size:10px;color:var(--muted);margin-top:3px;line-height:1.5}
.tab-activity-status{font-size:9px;font-weight:800;color:#64748b;white-space:nowrap;margin-left:auto}
.tab-loading{padding:14px 0;color:var(--muted);font-size:11px;text-align:center}

/* PROFILE SECTIONS */
.profile-section{margin-bottom:20px}
.profile-section-head{
  display:flex;justify-content:space-between;
  align-items:center;margin-bottom:12px;
}
.profile-section-head h4{font-size:13px;font-weight:900;color:#111827}
.btn-edit{
  display:inline-flex;align-items:center;gap:4px;
  background:#eef2ff;color:#4338ca;border:0;
  border-radius:6px;padding:5px 9px;
  font-size:10px;font-weight:800;cursor:pointer;
}
.btn-edit:hover{background:#c7d2fe}
.view-all-link{
  font-size:11px;font-weight:800;color:var(--blue);
  text-decoration:none;
}
.view-all-link:hover{text-decoration:underline}

/* INFO GRID */
.info-grid{
  display:grid;grid-template-columns:1fr 1fr;
  gap:12px 18px;
}
.info-item{font-size:11px}
.info-item label{
  display:block;font-size:10px;color:var(--muted);
  font-weight:800;text-transform:uppercase;
  letter-spacing:.3px;margin-bottom:3px;
}
.info-item div{
  color:#1e293b;font-weight:700;line-height:1.4;
  word-break:break-word;
}

/* CARD SUMMARY */
.card-summary-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:8px;
}
.cs-item{
  border-radius:10px;padding:12px 6px;text-align:center;
  border:1.5px solid transparent;
}
.cs-icon{
  display:grid;place-items:center;
  margin-bottom:6px;height:22px;
}
.cs-label{
  font-size:9px;font-weight:800;color:#475569;
  text-transform:uppercase;letter-spacing:.3px;
  line-height:1.2;min-height:22px;
}
.cs-value{
  font-size:18px;font-weight:900;
  margin-top:4px;line-height:1;
}

.cs-purple{background:#f5f3ff;border-color:#ddd6fe}
.cs-purple .cs-icon,.cs-purple .cs-value{color:var(--purple)}
.cs-blue{background:#eff6ff;border-color:#dbeafe}
.cs-blue .cs-icon,.cs-blue .cs-value{color:var(--blue)}
.cs-green{background:#f0fdf4;border-color:#bbf7d0}
.cs-green .cs-icon,.cs-green .cs-value{color:var(--green)}
.cs-pink{background:#fdf2f8;border-color:#fbcfe8}
.cs-pink .cs-icon,.cs-pink .cs-value{color:var(--pink)}

/* RECENT ACTIVITY */
.recent-activity-list{
  display:flex;flex-direction:column;gap:10px;
}
.recent-item{
  display:flex;gap:11px;align-items:flex-start;
  padding:10px;border-radius:9px;
  background:#f8fafc;border-left:3px solid var(--purple);
}
.recent-icon{
  width:32px;height:32px;border-radius:8px;
  display:grid;place-items:center;font-size:14px;
  background:#fff;flex-shrink:0;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
}
.recent-body{flex:1;min-width:0}
.recent-title{
  font-size:11px;font-weight:800;
  color:#1e293b;line-height:1.35;
}
.recent-title b{color:var(--purple)}
.recent-time{
  font-size:10px;color:var(--muted);
  margin-top:3px;font-weight:600;
}

/* ---------------------- RESPONSIVE ---------------------- */
@media(max-width:1400px){
  .main-grid{grid-template-columns:1fr 380px}
}
@media(max-width:1200px){
  .kpi-row{grid-template-columns:repeat(3,1fr)}
  .main-grid{grid-template-columns:1fr}
  .right-col{position:static}
  .filters-bar{grid-template-columns:1fr 1fr}
  .filter-search{grid-column:1 / -1}
}
@media(max-width:850px){
  .sidebar{width:72px;padding:22px 15px}
  .brand{display:none}
  .brand span{display:none}
  .nav-title{display:none}
  .nav a span{display:none}
  .nav a{justify-content:center}
  .main{margin-left:72px;width:calc(100% - 72px)}
  .topbar{padding:12px 14px;height:auto;flex-wrap:wrap;gap:10px}
  .search{width:100%;max-width:100%;order:3}
  .content{padding:16px}
  .page-head{flex-direction:column}
  .user-info{display:none}
}
@media(max-width:600px){
  .kpi-row{grid-template-columns:1fr}
  .tab-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .filters-bar{grid-template-columns:1fr}
  .info-grid{grid-template-columns:1fr}
  .card-summary-grid{grid-template-columns:repeat(2,1fr)}
  .biz-table{min-width:auto;font-size:11px}
  .biz-table th,.biz-table td{padding:8px 6px}
}

.main-grid.business-panel-closed{grid-template-columns:minmax(0,1fr)}

.business-period-bar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0 0 16px}
.business-period-bar .btn[aria-pressed="true"]{background:#4f46e5;border-color:#4f46e5;color:#fff}
#businessPeriodStatus{font-size:12px;color:#64748b;margin-left:6px}

.kpi-card[data-business-group]{cursor:pointer}
.kpi-card[data-business-group]:hover{box-shadow:0 4px 16px #4f46e526}
.kpi-card[data-business-group][aria-pressed="true"]{outline:2px solid #4f46e5;outline-offset:2px}
.kpi-card[data-business-group]:focus-visible{outline:3px solid #4f46e5;outline-offset:3px}
