/* ==========================================================================
   CUSTOM STYLE SHEET
   Sab colors / sizes CSS variables (:root) me hain — yahan values badal kar
   poore dashboard ki look change kar sakte ho.
   ========================================================================== */

:root {
    --sidebar-bg: #101828;
    --sidebar-bg-active: #1d2939;
    --sidebar-text: #cbd5e1;
    --sidebar-text-muted: #8896ab;
    --sidebar-accent: #4f7cff;

    --topbar-bg: #ffffff;
    --body-bg: #f4f6fb;
    --card-bg: #ffffff;
    --border-color: #e6e9f0;

    --text-dark: #1f2937;
    --text-muted: #6b7280;

    --primary: #4f7cff;
    --success: #17c964;
    --warning: #f5a524;
    --danger: #f31260;

    --sidebar-width: 270px;
    --sidebar-width-collapsed: 78px;
    --topbar-height: 72px;
    --radius: 12px;
    --transition: all .25s ease;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text-dark);
    margin: 0;
}

a { text-decoration: none; }

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

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    transition: var(--transition);
    min-width: 0;
}
body.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-width-collapsed); }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1030;
    transition: var(--transition);
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-width-collapsed); }

.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #2a3548; border-radius: 6px; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-logo {
    width: 44px; height: 44px; min-width: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--sidebar-accent), #7c4dff);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700;
    overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

.brand-text { overflow: hidden; white-space: nowrap; }
body.sidebar-collapsed .brand-text { display: none; }

.company-name {
    color: #fff; font-weight: 600; font-size: 15px; line-height: 1.2;
    overflow: hidden; text-overflow: ellipsis;
}
.company-designation { color: var(--sidebar-text-muted); font-size: 12px; margin-top: 2px; }

.sidebar-nav { padding: 14px 10px 30px; }

.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 12px;
    color: var(--sidebar-text);
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 14px; font-weight: 500;
    margin-bottom: 3px;
    transition: var(--transition);
    white-space: nowrap;
}
.sidebar-nav .nav-link i:first-child { font-size: 17px; min-width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--sidebar-bg-active); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--sidebar-accent); color: #fff; }

.sidebar-nav .tab-toggle .chevron { margin-left: auto; font-size: 12px; transition: transform .2s ease; }
.sidebar-nav .tab-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.sidebar-nav .tab-toggle[aria-expanded="true"] { background: var(--sidebar-bg-active); color: #fff; }

.sub-nav { padding-left: 14px; margin-top: 2px; }
.sub-nav .nav-link { font-size: 13.5px; font-weight: 400; padding: 9px 12px; color: var(--sidebar-text-muted); }
.sub-nav .nav-link i.bi-dot { font-size: 20px; min-width: 14px; }
.sub-nav .nav-link:hover { color: #fff; }
.sub-nav .nav-link.active { background: rgba(79,124,255,.15); color: #fff; font-weight: 500; }

body.sidebar-collapsed .sub-nav,
body.sidebar-collapsed .sidebar-nav .nav-link span,
body.sidebar-collapsed .sidebar-nav .chevron { display: none; }

/* ---------- Topbar ---------- */
.topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; gap: 20px;
    padding: 0 22px;
    position: sticky; top: 0; z-index: 1020;
    flex-wrap: wrap;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }

.btn-toggle-sidebar {
    border: none; background: var(--body-bg);
    width: 40px; height: 40px; border-radius: 10px;
    font-size: 18px; color: var(--text-dark);
    display: flex; align-items: center; justify-content: center;
}
.btn-toggle-sidebar:hover { background: #e9edf5; }

.topbar-title { font-weight: 600; line-height: 1.2; }
.topbar-title small { display: block; font-weight: 400; font-size: 12px; }

.topbar-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-left: auto; margin-right: auto; }

.stat-chip {
    display: flex; align-items: center; gap: 10px;
    background: var(--body-bg);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 150px;
}
.stat-chip i { font-size: 20px; }
.stat-chip .stat-value { display: block; font-weight: 600; font-size: 14px; line-height: 1.2; }
.stat-chip .stat-label { display: block; font-size: 11px; color: var(--text-muted); }

.stat-primary i { color: var(--primary); }
.stat-success i { color: var(--success); }
.stat-warning i { color: var(--warning); }
.stat-danger  i { color: var(--danger); }

.topbar-user { margin-left: auto; }
.user-toggle { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; color: var(--text-dark); }
.user-toggle:hover { background: var(--body-bg); }

.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.user-role { font-size: 11.5px; color: var(--text-muted); }

/* ---------- Main content ---------- */
.main-content { padding: 24px; flex: 1; }
.main-content h4 { font-weight: 600; margin-bottom: 4px; }

.content-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); }

.dash-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }

.main-footer { padding: 16px 24px; font-size: 12.5px; color: var(--text-muted); border-top: 1px solid var(--border-color); background: var(--topbar-bg); }

/* ---------- Sidebar backdrop (mobile) ---------- */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1025; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sidebar-mobile-open .sidebar { transform: translateX(0); }
    body.sidebar-mobile-open .sidebar-backdrop { display: block; }
    .main-wrapper, body.sidebar-collapsed .main-wrapper { margin-left: 0; }
    .topbar-stats { order: 3; width: 100%; justify-content: flex-start; }
}


.dt-wrapper.content-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--radius); }
.dt-header { padding: 18px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.dt-header h5 { margin: 0; font-weight: 600; }
.dt-header p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-muted); }

.dt-toolbar { padding: 16px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--border-color); }
.dt-toolbar .dt-search { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
.dt-toolbar .dt-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }
.dt-toolbar .dt-search input { padding-left: 34px; border-radius: 8px; border: 1px solid var(--border-color); font-size: 13.5px; }
.dt-toolbar select { border-radius: 8px; border: 1px solid var(--border-color); font-size: 13.5px; }
.dt-toolbar .dt-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.btn-primary-dt { background: var(--primary); border-color: var(--primary); }
.btn-primary-dt:hover { background: #3d68e8; border-color: #3d68e8; }
.btn-outline-dt { border: 1px solid var(--border-color); color: var(--text-dark); background: #fff; }
.btn-outline-dt:hover { background: var(--body-bg); }

.dt-table-scroll { overflow-x: auto; }
table.dt-table { width: 100%; margin: 0; font-size: 13.5px; }
table.dt-table thead th {
    background: var(--body-bg);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: .3px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    white-space: nowrap;
}
table.dt-table tbody td { padding: 12px 16px; vertical-align: middle; border-bottom: 1px solid var(--border-color); color: var(--text-dark); }
table.dt-table tbody tr:last-child td { border-bottom: none; }
table.dt-table tbody tr:hover { background: #fafbfe; }

.dt-badge { padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; display: inline-block; }
.dt-badge.active { background: rgba(23,201,100,.12); color: var(--success); }
.dt-badge.inactive { background: rgba(243,18,96,.1); color: var(--danger); }
.dt-badge.pending { background: rgba(245,165,36,.12); color: var(--warning); }

.dt-action-btns { display: flex; gap: 6px; }
.dt-icon-btn {
    width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border-color);
    background: #fff; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13.5px; color: var(--text-muted); transition: var(--transition); cursor: pointer;
}
.dt-icon-btn.view:hover { background: rgba(79,124,255,.1); color: var(--primary); border-color: var(--primary); }
.dt-icon-btn.edit:hover { background: rgba(245,165,36,.1); color: var(--warning); border-color: var(--warning); }
.dt-icon-btn.delete:hover { background: rgba(243,18,96,.1); color: var(--danger); border-color: var(--danger); }

.dt-footer { padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.dt-footer .dt-info { font-size: 12.5px; color: var(--text-muted); }
.dt-pagination .page-link { color: var(--text-dark); border-color: var(--border-color); font-size: 13px; }
.dt-pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

.dt-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.dt-empty i { font-size: 34px; display: block; margin-bottom: 10px; opacity: .5; }

.modal-content { border-radius: var(--radius); border: none; }
.modal-header { border-bottom: 1px solid var(--border-color); }
.modal-footer { border-top: 1px solid var(--border-color); }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-dark); }
.form-control, .form-select { font-size: 13.5px; border-color: var(--border-color); border-radius: 8px; }
.dt-view-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border-color); font-size: 13.5px; }
.dt-view-row:last-child { border-bottom: none; }
.dt-view-row .lbl { color: var(--text-muted); }
.dt-view-row .val { font-weight: 500; }


/* ---- Reusable view / form dialogs (append to assets/css/style.css) ---- */
.dt-form-modal .dt-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.dt-form-modal .modal-body, .dt-view-modal .modal-body { overflow-y: auto; padding: 20px 24px; }
.dt-form-modal .form-label { font-size: 12.5px; font-weight: 500; margin-bottom: 4px; }
.dt-section {
  font-size: 12px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
  color: var(--bs-secondary-color); border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 6px; margin-top: 6px;
}
.dt-view-item {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  padding: 10px 14px; background: var(--bs-tertiary-bg); border-radius: 8px;
}
.dt-view-item .lbl { font-size: 11.5px; color: var(--bs-secondary-color); }
.dt-view-item .val { font-size: 14px; font-weight: 500; word-break: break-word; }
.dt-view-item img  { max-height: 120px; border-radius: 6px; }

/* KYC Status */
.dt-badge.verified {
    background: rgba(23, 201, 100, 0.12);
    color: #129a4a;
}

.dt-badge.pending {
    background: rgba(245, 165, 36, 0.12);
    color: #c47f00;
}

.dt-badge.rejected {
    background: rgba(243, 18, 96, 0.10);
    color: #d10d52;
}