/* ==========================================================================
   SMART RENT HUB — Premium SaaS Design System
   ========================================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff4ff;
    --secondary: #4f46e5;
    --accent: #10b981;
    --success: #16a34a;
    --success-bg: #e9f9ef;
    --warning: #f59e0b;
    --warning-bg: #fef6e7;
    --danger: #ef4444;
    --danger-bg: #fdecec;
    --info: #0ea5e9;
    --info-bg: #eaf7fd;

    --bg: #f5f7fb;
    --card: #ffffff;
    --sidebar: #0f172a;
    --sidebar-soft: #16213a;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-text: #a9b4cc;
    --sidebar-text-active: #ffffff;

    --ink: #101828;
    --muted: #6b7280;
    --muted-soft: #9aa3b2;
    --border: #e7eaf3;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow: 0 4px 16px rgba(16, 24, 40, 0.06);
    --shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.10);
    --sidebar-w: 264px;

    font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ---------------------------------------------------------------------- *
 * App Shell / Sidebar / Topbar
 * ---------------------------------------------------------------------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--sidebar) 0%, #0b1220 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.25s ease;
}

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

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 17px;
    color: #fff;
    letter-spacing: -0.2px;
    line-height: 1.15;
}

.sidebar-brand .brand-text span { color: #60a5fa; }
.sidebar-brand .brand-sub {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--sidebar-text);
    margin-top: 1px;
}

.sidebar-section-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #566079;
    font-weight: 600;
    padding: 18px 22px 8px;
}

.sidebar-nav {
    flex: 1;
    padding: 6px 14px;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    transition: all 0.15s ease;
    position: relative;
}

.sidebar-nav .nav-item i { width: 18px; text-align: center; font-size: 15px; opacity: 0.9; }

.sidebar-nav .nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background: linear-gradient(90deg, rgba(37,99,235,0.25), rgba(37,99,235,0.05));
    color: #fff;
}

.sidebar-nav .nav-item.active::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: var(--primary);
}

.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer .nav-item.logout:hover { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

.sidebar-toggle {
    display: none;
    border: none;
    background: var(--card);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1020;
}

.main-area {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 68px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1010;
}

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.topbar-title .crumb-muted { color: var(--muted-soft); font-weight: 500; }

.topbar-spacer { flex: 1; }

.topbar-profile { display: flex; align-items: center; gap: 14px; }

.badge-role {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 13px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.badge-role.admin { background: var(--primary-light); color: var(--primary-dark); }
.badge-role.tenant { background: var(--success-bg); color: #0f7a3d; }

.profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: 24px;
    background: #f2f4f9;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
}

.avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.content-wrapper {
    padding: 28px 32px 48px;
    max-width: 1360px;
    width: 100%;
}

@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .main-area { margin-left: 0; }
    .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar-overlay.open { display: block; }
    .content-wrapper { padding: 20px 16px 40px; }
    .topbar { padding: 0 16px; }
}

/* ---------------------------------------------------------------------- *
 * Page wrapper (kept for compatibility with existing markup)
 * ---------------------------------------------------------------------- */

.page-wrapper { max-width: 100%; margin: 0; padding: 0; }

/* ---------------------------------------------------------------------- *
 * Header card
 * ---------------------------------------------------------------------- */

.header-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 22px 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-card h4 {
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
}

.header-card h4 i { color: var(--primary); font-size: 18px; }

.header-card .subtitle { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }

/* ---------------------------------------------------------------------- *
 * Stats cards
 * ---------------------------------------------------------------------- */

.stats-row, .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-card, .stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stats-card:hover, .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: #dbe3f6;
}

.stats-card .info .number, .stat-card .stat-content .number, .stat-card .number {
    font-size: 25px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stats-card .info .label, .stat-card .stat-content .label, .stat-card .label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    margin-top: 2px;
}

.stats-card .icon, .stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.icon.blue, .stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.icon.green, .stat-icon.green { background: var(--success-bg); color: var(--success); }
.icon.red, .stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.icon.orange, .stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.icon.purple, .stat-icon.purple { background: #f1edfe; color: var(--secondary); }
.icon.teal, .stat-icon.teal { background: #e5f8f6; color: #0d9488; }

/* ---------------------------------------------------------------------- *
 * Card custom (detail / info panels)
 * ---------------------------------------------------------------------- */

.card-custom {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    margin-bottom: 22px;
}

.card-header-custom {
    padding: 16px 22px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-custom h6 {
    margin: 0;
    font-weight: 700;
    color: var(--ink);
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-custom h6 i { color: var(--primary); }

.card-body-custom { padding: 22px; }

.two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f3f8;
    font-size: 14px;
}

.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--muted); font-weight: 500; }
.detail-row .value { color: var(--ink); font-weight: 600; }
.detail-row .value.amount { color: var(--primary-dark); font-weight: 700; }

.status-indicator { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.hijau { background: var(--success); box-shadow: 0 0 0 3px var(--success-bg); }
.status-dot.merah { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }

/* ---------------------------------------------------------------------- *
 * Table container
 * ---------------------------------------------------------------------- */

.table-container {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-toolbar {
    padding: 14px 22px;
    background: #fbfcfe;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.table-toolbar .nav-links { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted-soft); }
.table-toolbar .nav-links a { color: var(--muted-soft); font-weight: 500; }
.table-toolbar .nav-links a:hover { color: var(--primary); }
.table-toolbar .nav-links .separator { color: #d7dcea; }
.table-toolbar .table-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.table-toolbar .table-name span { color: var(--primary); }
.table-toolbar .actions { display: flex; gap: 8px; }

.btn-toolbar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    transition: all 0.15s ease;
}
.btn-toolbar:hover { background: var(--primary-light); border-color: #c7d7fb; color: var(--primary-dark); }

.table { margin: 0; font-size: 14px; }
.table thead th {
    background: #fbfcfe;
    color: #4b5468;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 13px 20px;
    border-bottom: 1px solid var(--border);
    border-top: none;
    white-space: nowrap;
}
.table tbody td { padding: 14px 20px; vertical-align: middle; border-bottom: 1px solid #f1f3f8; color: #374151; }
.table tbody tr { transition: background 0.12s ease; }
.table tbody tr:hover { background: #f8fafd; }
.table tbody tr:last-child td { border-bottom: none; }
.table-history th, .table-history td { padding: 12px 20px; }

.table-info-footer {
    padding: 13px 22px;
    background: #fbfcfe;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--muted-soft);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.table-info-footer span { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------------- *
 * Status badges
 * ---------------------------------------------------------------------- */

.badge-status {
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.01em;
}
.badge-status.lunas { background: var(--success-bg); color: #0f7a3d; }
.badge-status.belum { background: var(--danger-bg); color: #c1272d; }
.badge-status.pending { background: var(--warning-bg); color: #b45309; }
.badge-status.tiada { background: #f1f2f6; color: #7a8296; }
.badge-status.disewa { background: var(--danger-bg); color: #c1272d; }
.badge-status.kosong { background: var(--success-bg); color: #0f7a3d; }

.text-muted-custom { color: var(--muted-soft); font-size: 13px; }

/* ---------------------------------------------------------------------- *
 * Buttons
 * ---------------------------------------------------------------------- */

.btn-add {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-add:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 8px 18px rgba(37, 99, 235, 0.32); }

.btn-lihat, .btn-biodata, .btn-edit-action, .btn-bayar {
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px 15px;
    font-weight: 600;
    font-size: 12.5px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
}
.btn-lihat { background: var(--primary); }
.btn-lihat:hover { background: var(--primary-dark); color: #fff; }
.btn-biodata { background: var(--info); }
.btn-biodata:hover { background: #0284c7; color: #fff; }
.btn-edit-action { background: var(--primary-light); color: var(--primary-dark); }
.btn-edit-action:hover { background: #dbe7ff; }
.btn-padam-action {
    background: var(--danger-bg);
    color: #c1272d;
    border: none;
    border-radius: var(--radius-sm);
    padding: 7px 15px;
    font-weight: 600;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.btn-padam-action:hover { background: #fbd9d9; color: #a11c22; }
.btn-tamat-action { background: var(--warning-bg); color: #b45309; border: none; border-radius: var(--radius-sm); padding: 7px 15px; font-weight: 600; font-size: 12.5px; }

.btn-bayar { background: var(--accent); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28); }
.btn-bayar:hover { background: #0d9c6c; color: #fff; }

.btn-batal {
    background: #f1f2f6;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    font-weight: 600;
    color: #5b6272;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-batal:hover { background: #e4e6ee; color: #333; }

.btn-simpan {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-weight: 700;
    color: #fff;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-simpan:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }

.btn-edit {
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 32px;
    font-weight: 700;
    color: #fff;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}
.btn-edit:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); }

.btn-back {
    background: #f1f2f6;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 26px;
    font-weight: 600;
    color: #5b6272;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-back:hover { background: #e4e6ee; color: #333; }

.action-buttons { margin-top: 24px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------- *
 * Forms & modals
 * ---------------------------------------------------------------------- */

.form-label { font-weight: 600; font-size: 13.5px; color: #374151; margin-bottom: 6px; }
.form-label i { color: var(--primary) !important; }
.required { color: var(--danger); }

.form-control, .form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    background: #fbfcfe;
    transition: all 0.15s ease;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}
.form-text { font-size: 12px; color: var(--muted-soft); }

.modal-content { border: none; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { background: #fbfcfe; border-bottom: 1px solid var(--border); padding: 18px 24px; }
.modal-title { font-weight: 700; font-size: 16px; color: var(--ink); display: flex; align-items: center; }
.modal-title i { color: var(--primary); }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 24px; }

.alert-custom, .alert { border-radius: var(--radius-sm); border: none; font-size: 14px; }
.alert-danger, .alert-error { background: var(--danger-bg); color: #b91c1c; }
.alert-success { background: var(--success-bg); color: #0f7a3d; }

.info-box, .info-badge {
    background: var(--primary-light);
    border: 1px dashed #b9cdfb;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    color: #334;
}

/* ---------------------------------------------------------------------- *
 * Empty state
 * ---------------------------------------------------------------------- */

.empty-state { text-align: center; padding: 56px 20px; }
.empty-state i { font-size: 46px; color: #d7dcea; margin-bottom: 14px; }
.empty-state h5, .empty-state h6 { color: #4b5468; margin-bottom: 6px; font-weight: 700; }
.empty-state p { color: var(--muted-soft); font-size: 13.5px; margin: 0; }

/* ---------------------------------------------------------------------- *
 * Dashboard profile header (tenant dashboard) & edit-profile card
 * ---------------------------------------------------------------------- */

.profile-info h4 { font-weight: 700; color: var(--ink); margin: 0; letter-spacing: -0.3px; }
.profile-info .subtitle { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.profile-badge { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.badge-custom {
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}
.badge-custom.tenant { background: var(--primary-light); color: var(--primary-dark); }
.badge-custom.active { background: var(--success-bg); color: #0f7a3d; }

.edit-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    max-width: 720px;
    margin: 0 auto;
}
.edit-header {
    background: linear-gradient(135deg, var(--sidebar) 0%, #1c2a4a 100%);
    padding: 26px 30px;
    color: #fff;
}
.edit-header h4 { margin: 0; font-weight: 700; letter-spacing: -0.3px; display: flex; align-items: center; gap: 10px; }
.edit-header .subtitle { color: rgba(255,255,255,0.7); font-size: 13.5px; margin-top: 4px; }
.edit-body { padding: 30px; }

.text-ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }

/* ---------------------------------------------------------------------- *
 * Profile page
 * ---------------------------------------------------------------------- */

.profile-card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; max-width: 820px; margin: 0 auto; }

/* Standalone page-level profile header (e.g. tenant dashboard greeting card) */
.profile-header {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

/* Dark hero variant used inside the dedicated profile.php card */
.profile-card > .profile-header {
    background: linear-gradient(135deg, var(--sidebar) 0%, #1c2a4a 100%);
    padding: 34px 32px 26px;
    color: #fff;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}
.profile-avatar {
    width: 84px; height: 84px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 34px; color: #fff; flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.profile-title h4 { font-weight: 700; margin: 0; letter-spacing: -0.3px; }
.profile-title .badge-role { background: rgba(255,255,255,0.14); color: #fff; padding: 5px 15px; border-radius: 20px; font-size: 12px; font-weight: 600; display: inline-flex; margin-top: 8px; }
.profile-body { padding: 30px 32px; }
.info-row { display: flex; padding: 13px 0; border-bottom: 1px solid #f1f3f8; }
.info-row:last-child { border-bottom: none; }
.info-row .label { width: 170px; color: var(--muted); font-size: 13.5px; flex-shrink: 0; font-weight: 500; }
.info-row .value { font-weight: 600; color: var(--ink); }
.profile-body .stats-grid { grid-template-columns: repeat(3, 1fr); margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--border); margin-bottom: 0; }
.stat-item { text-align: center; background: #f8f9fc; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.stat-item .number { font-size: 22px; font-weight: 800; color: var(--ink); }
.stat-item .number.gold { color: var(--warning); }
.stat-item .number.green { color: var(--success); }
.stat-item .number.blue { color: var(--primary); }
.stat-item .label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------------------- *
 * Extra components (tenant detail page, dashboard badges, profile role badge)
 * ---------------------------------------------------------------------- */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.info-item { background: #f8f9fc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.info-item .label { font-size: 12px; color: var(--muted-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.info-item .value { font-size: 14.5px; color: var(--ink); font-weight: 600; }

.stats-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--border); }
.stats-mini .stat { text-align: center; background: #f8f9fc; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.stats-mini .stat .number { font-size: 21px; font-weight: 800; color: var(--ink); }
.stats-mini .stat.green .number { color: var(--success); }
.stats-mini .stat.red .number { color: var(--danger); }
.stats-mini .stat .label { font-size: 12px; color: var(--muted); margin-top: 3px; }

.badge-status.aktif { background: var(--success-bg); color: #0f7a3d; }
.badge-status.tidak { background: #f1f2f6; color: #7a8296; }

.user-badge { display: flex; gap: 8px; flex-wrap: wrap; }
.user-badge .badge, .badge.bg-warning, .badge.bg-light {
    padding: 7px 14px !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    font-size: 12.5px !important;
}
.badge.bg-warning { background: var(--primary-light) !important; color: var(--primary-dark) !important; }
.badge.bg-light { background: #f1f2f6 !important; color: #4b5468 !important; }

.role-badge-display {
    background: var(--primary-light);
    border: 1px dashed #b9cdfb;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13.5px;
    color: #334;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.role-badge-display i { color: var(--primary); }

/* ---------------------------------------------------------------------- *
 * Utility
 * ---------------------------------------------------------------------- */

::selection { background: rgba(37, 99, 235, 0.2); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd6e6; border-radius: 8px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

@media (max-width: 768px) {
    .header-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .stats-row, .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .table-toolbar { flex-direction: column; align-items: flex-start; }
    .table-toolbar .nav-links { flex-wrap: wrap; }
    .table-info-footer { flex-direction: column; gap: 5px; }
    .profile-header { flex-direction: column; text-align: center; padding: 28px; }
    .info-row { flex-direction: column; gap: 4px; }
    .info-row .label { width: 100%; }
    .profile-body .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stats-row, .stats-grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   Profile Avatar & Chip
   ========================================================================== */

.profile-chip-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: 24px;
    background: #f2f4f9;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.profile-chip-link:hover {
    background: #e8ecf5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: var(--ink);
    text-decoration: none;
}

.profile-chip-link .avatar-sm {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-chip-link .avatar-sm img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-chip-link i.fa-chevron-right {
    font-size: 10px;
    color: var(--muted-soft);
    margin-left: 2px;
    transition: transform 0.2s ease;
}

.profile-chip-link:hover i.fa-chevron-right {
    color: var(--primary);
    transform: translateX(2px);
}

/* Profile page avatar besar */
.profile-avatar-lg {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    overflow: hidden;
}

.profile-avatar-lg img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-lg .avatar-text {
    font-size: 42px;
    font-weight: 700;
}
/* Dashboard columns & notification cards */
.dashboard-column{background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:1rem;margin-bottom:1.25rem;box-shadow:0 4px 14px rgba(15,23,42,.05)}
.dashboard-column .section-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:.75rem}
.dashboard-column .section-heading h5{margin:0;color:#0f172a;font-weight:700}
.notification-item{border-left:4px solid #2563eb;background:#f8fafc;border-radius:8px;padding:.75rem 1rem;margin:.5rem 0;color:#1e293b}
.notification-item.warning{border-left-color:#d97706}.notification-item.success{border-left-color:#16a34a}.notification-item.danger{border-left-color:#dc2626}
.notification-item small{display:block;color:#64748b;margin-top:.3rem}
.btn-reminder-action{display:inline-flex;align-items:center;background:#128c5a;color:#fff;border-radius:7px;padding:.42rem .65rem;margin-right:.35rem;font-size:.82rem;text-decoration:none;min-height:36px}.btn-reminder-action:hover{background:#0d7048;color:#fff}
@media (min-width:992px){.dashboard-column{max-width:100%;}.dashboard-column + .profile-header{margin-top:0}}
