/* =====================================================
   PMSC ROTO ROOTER - DESIGN SYSTEM
   Mobile-first, modern, elegant.
   ===================================================== */

:root {
    /* Brand colors */
    --brand-primary: #C8102E;        /* Roto Rooter red */
    --brand-primary-dark: #A00C24;
    --brand-primary-light: #E84256;
    --brand-secondary: #1A2B4C;      /* Deep navy */
    --brand-secondary-light: #2A3F66;
    --brand-accent: #F4B400;         /* Gold accent */

    /* Tier colors */
    --tier-bronze: #CD7F32;
    --tier-silver: #A6A6A6;
    --tier-gold: #D4AF37;
    --tier-platinum: #5D6975;

    /* Status colors */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --danger:  #EF4444;
    --danger-bg: #FEF2F2;
    --info:    #3B82F6;
    --info-bg: #EFF6FF;

    /* Neutrals */
    --bg:      #F4F6FA;
    --surface: #FFFFFF;
    --surface-elev: #FBFCFE;
    --border:  #E5E7EB;
    --border-strong: #D1D5DB;
    --text:    #111827;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;

    /* Layout */
    --radius:    12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow:    0 2px 8px rgba(17, 24, 39, 0.08);
    --shadow-lg: 0 8px 24px rgba(17, 24, 39, 0.12);
    --bottom-nav-h: 64px;
    --topbar-h: 56px;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: var(--brand-secondary); text-decoration: none; }
a:hover { color: var(--brand-primary); }

img { max-width: 100%; }

/* =====================================================
   APP LAYOUT — MOBILE FIRST
   ===================================================== */
.app-shell {
    min-height: 100vh;
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
}

/* Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    background: var(--brand-secondary);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: var(--shadow);
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    margin: 0;
    letter-spacing: 0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-action {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-left: 8px;
}
.topbar-action:active { background: rgba(255,255,255,0.2); }

.topbar-back {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    margin-right: 8px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

/* Bottom nav (mobile only) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 12px rgba(17, 24, 39, 0.04);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 4px 6px;
    transition: color 0.15s;
    position: relative;
}
.bottom-nav-item .icon {
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.bottom-nav-item.active {
    color: var(--brand-primary);
}
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 25%; right: 25%;
    height: 3px;
    background: var(--brand-primary);
    border-radius: 0 0 3px 3px;
}

/* Sidebar (desktop) — hidden on mobile */
.sidebar { display: none; }

/* Content area */
.content {
    padding: 16px;
    max-width: 100%;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 16px;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-body { padding: 16px; }
.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-elev);
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface-elev);
}

/* Stat card */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}
.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.stat-card .stat-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--info-bg);
    color: var(--info);
}
.stat-card.danger .stat-icon { background: var(--danger-bg); color: var(--danger); }
.stat-card.success .stat-icon { background: var(--success-bg); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-bg); color: var(--warning); }
.stat-card.brand .stat-icon { background: rgba(200, 16, 46, 0.1); color: var(--brand-primary); }

/* Reminder card / item */
.reminder-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 12px;
}
.reminder-card .rc-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.reminder-card .rc-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    line-height: 1.3;
}
.reminder-card .rc-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}
.reminder-card .rc-loc {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 10px;
}
.reminder-card .rc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
    border-top: 1px dashed var(--border);
}
.reminder-card .rc-row:first-of-type { border-top: none; padding-top: 0; }
.reminder-card .rc-row .label { color: var(--text-muted); }
.reminder-card .rc-row .value { font-weight: 500; color: var(--text); }
.reminder-card .rc-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.reminder-card .rc-actions .btn { flex: 1; min-width: 0; }

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    background: var(--border);
    color: var(--text);
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.badge-tier-bronze   { background: rgba(205, 127, 50, 0.15); color: var(--tier-bronze); }
.badge-tier-silver   { background: rgba(166, 166, 166, 0.2); color: #555; }
.badge-tier-gold     { background: rgba(212, 175, 55, 0.18); color: #B8860B; }
.badge-tier-platinum { background: rgba(93, 105, 117, 0.18); color: var(--tier-platinum); }

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-neutral { background: #F3F4F6; color: var(--text-muted); }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
    min-height: 40px;
    background: var(--surface);
    color: var(--text);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled {
    opacity: 0.5; cursor: not-allowed; transform: none;
}

.btn-primary {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.btn-primary:hover {
    background: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    color: #fff;
}

.btn-secondary {
    background: var(--brand-secondary);
    color: #fff;
    border-color: var(--brand-secondary);
}
.btn-secondary:hover { background: var(--brand-secondary-light); color: #fff; }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }

.btn-outline {
    background: var(--surface);
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-outline:hover { background: var(--surface-elev); border-color: var(--brand-primary); color: var(--brand-primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-elev); color: var(--text); }

.btn-wa {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}
.btn-wa:hover { background: #1EB958; color: #fff; }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; min-height: 32px; font-size: 12px; }
.btn-lg { padding: 14px 20px; min-height: 48px; font-size: 14px; }

/* =====================================================
   FORMS
   ===================================================== */
.form-group { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}
.form-label .req { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    min-height: 42px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}
textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.form-help { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 640px) {
    .form-row.cols-2 { grid-template-columns: 1fr 1fr; }
    .form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================
   ALERTS / EMPTY / LOADING
   ===================================================== */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.alert-success { background: var(--success-bg); border-color: rgba(16, 185, 129, 0.3); color: #047857; }
.alert-warning { background: var(--warning-bg); border-color: rgba(245, 158, 11, 0.3); color: #92400E; }
.alert-danger  { background: var(--danger-bg);  border-color: rgba(239, 68, 68, 0.3);  color: #991B1B; }
.alert-info    { background: var(--info-bg);    border-color: rgba(59, 130, 246, 0.3);  color: #1E40AF; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state .icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 12px;
}
.empty-state .title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty-state .desc  { font-size: 13px; }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}
.loading-overlay .spinner { width: 32px; height: 32px; color: var(--brand-primary); border-width: 3px; }

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 480px;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 8px;
    pointer-events: auto;
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: slideIn 0.25s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }
@keyframes slideIn { from { transform: translateY(-12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* =====================================================
   MODALS
   ===================================================== */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(17, 24, 39, 0.6);
    z-index: 500;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px);
}
.modal-backdrop.show { display: flex; animation: fadeIn 0.2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); } to { transform: translateY(0); } }

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-title { font-size: 16px; font-weight: 600; margin: 0; }
.modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}
.modal-body { padding: 16px; }
.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* =====================================================
   TABLE (DESKTOP ONLY)
   ===================================================== */
.table-wrapper { display: none; }

/* Login page */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-secondary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}
.login-brand {
    text-align: center;
    margin-bottom: 24px;
}
.login-brand .logo {
    width: 56px; height: 56px;
    margin: 0 auto 12px;
    background: var(--brand-primary);
    border-radius: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    box-shadow: var(--shadow);
}
.login-brand .title { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.login-brand .subtitle { color: var(--text-muted); font-size: 13px; margin: 0; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.filter-chip.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
}

/* Search input */
.search-input-wrap {
    position: relative;
    margin-bottom: 12px;
}
.search-input-wrap .icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}
.search-input-wrap input {
    padding-left: 36px;
}

/* Customer detail tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}
.tab {
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

/* History list item */
.history-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}
.history-item:last-child { border-bottom: none; }
.history-item .h-title { font-weight: 500; font-size: 13px; color: var(--text); }
.history-item .h-meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* =====================================================
   DESKTOP: SIDEBAR + WIDER CONTENT
   ===================================================== */
@media (min-width: 992px) {
    body { background: var(--bg); }

    .app-shell {
        padding-bottom: 0;
        padding-left: 240px;
    }

    .topbar {
        left: 240px;
        right: 0;
        position: fixed;
    }

    .content {
        padding: 24px 32px;
        margin-top: var(--topbar-h);
        max-width: 1400px;
    }

    .bottom-nav { display: none !important; }

    .sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 240px;
        background: var(--brand-secondary);
        color: #fff;
        z-index: 200;
        overflow-y: auto;
    }
    .sidebar-brand {
        padding: 16px 20px;
        font-weight: 700;
        font-size: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .sidebar-brand .logo {
        width: 32px; height: 32px;
        background: var(--brand-primary);
        border-radius: 8px;
        display: flex; align-items: center; justify-content: center;
        font-size: 14px; font-weight: 700;
    }
    .sidebar-nav {
        padding: 12px 0;
        flex: 1;
    }
    .sidebar-section {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 1px;
        padding: 14px 20px 6px;
        color: rgba(255,255,255,0.4);
    }
    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 20px;
        color: rgba(255,255,255,0.75);
        font-size: 13px;
        text-decoration: none;
        border-left: 3px solid transparent;
    }
    .sidebar-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
    .sidebar-link.active {
        background: rgba(255,255,255,0.08);
        color: #fff;
        border-left-color: var(--brand-primary);
    }
    .sidebar-link .icon { width: 18px; text-align: center; }

    .sidebar-footer {
        padding: 12px 16px;
        border-top: 1px solid rgba(255,255,255,0.08);
        font-size: 12px;
    }
    .sidebar-footer .user-name { font-weight: 600; color: #fff; }
    .sidebar-footer .user-role { color: rgba(255,255,255,0.5); font-size: 11px; }

    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .stat-card .stat-value { font-size: 28px; }

    /* Tables show on desktop */
    .table-wrapper {
        display: block;
        background: var(--surface);
        border-radius: var(--radius);
        border: 1px solid var(--border);
        overflow-x: auto;
        box-shadow: var(--shadow-sm);
    }
    .table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
    }
    .table th, .table td {
        padding: 12px 14px;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }
    .table th {
        background: var(--surface-elev);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.4px;
    }
    .table tr:last-child td { border-bottom: none; }
    .table tr:hover { background: var(--surface-elev); }

    /* Hide mobile cards on desktop where table is preferred */
    .desktop-hide { display: none; }
}

@media (max-width: 991px) {
    .desktop-only { display: none !important; }
}

/* Utility */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-bold { font-weight: 600; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* Number badge in nav */
.nav-counter {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    background: var(--brand-primary);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

/* Action FAB (mobile) */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-lg);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 90;
}
@media (min-width: 992px) {
    .fab { bottom: 24px; right: 24px; }
}

/* =====================================================
   APPENDED — Layout & components untuk halaman PMSC
   ===================================================== */

/* Topbar (override / refine) */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--brand-secondary);
    color: #fff;
    height: 56px;
    display: flex; align-items: center;
    padding: 0 12px;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.topbar-menu { background: transparent; border: 0; color:#fff; font-size: 22px; padding: 8px; cursor: pointer; }
.topbar-brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 15px; }
.brand-logo {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--brand-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 13px; letter-spacing: -0.5px;
}
.brand-text { font-weight: 700; }
.brand-sub { font-weight: 400; opacity: 0.7; font-size: 12px; margin-left: 4px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-icon {
    color: #fff; padding: 8px 10px; border-radius: 8px;
    font-size: 18px; position: relative;
    transition: background 0.15s;
}
.topbar-icon:hover { background: rgba(255,255,255,0.1); color:#fff; }
.topbar-badge {
    position: absolute; top: 4px; right: 4px;
    background: var(--brand-primary); color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1px 5px; border-radius: 10px; line-height: 1.4;
}
.topbar-user { display: flex; align-items: center; gap: 8px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,0.15); margin-left: 4px; font-size: 13px; }

/* Sidebar */
.sidebar {
    position: fixed; top: 0; left: -260px;
    width: 260px; height: 100vh;
    background: #fff; border-right: 1px solid var(--border);
    z-index: 100; overflow-y: auto;
    transition: left 0.25s ease;
    display: flex; flex-direction: column;
}
.sidebar.open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,0.1); }
.sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 99; display: none;
}
.sidebar-backdrop.show { display: block; }
.sidebar-header {
    height: 56px; padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.btn-icon { background: transparent; border: 0; padding: 6px 10px; font-size: 18px; cursor: pointer; }
.sidebar-nav { flex: 1; padding: 12px 8px; }
.nav-section {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); padding: 12px 12px 6px;
    font-weight: 600;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    color: var(--text); font-size: 14px; font-weight: 500;
    transition: background 0.15s;
    position: relative;
}
.nav-item:hover { background: #F3F4F6; color: var(--text); }
.nav-item.active { background: var(--brand-primary); color: #fff; }
.nav-item.active:hover { background: var(--brand-primary-dark); color: #fff; }
.nav-item i { font-size: 16px; width: 20px; text-align: center; }
.nav-badge {
    margin-left: auto; background: var(--brand-primary); color: #fff;
    font-size: 11px; font-weight: 700;
    padding: 1px 7px; border-radius: 10px;
}
.nav-item.active .nav-badge { background: #fff; color: var(--brand-primary); }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }

/* Main wrap */
.main-wrap { padding: 16px; min-height: calc(100vh - 56px); }
.main-wrap.with-nav { padding-bottom: 84px; } /* room for bottom nav */

/* Bottom nav */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 64px; background: #fff;
    border-top: 1px solid var(--border);
    display: flex; align-items: stretch;
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
}
.bnav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 11px; gap: 2px;
    position: relative;
    text-decoration: none;
}
.bnav-item i { font-size: 20px; }
.bnav-item.active { color: var(--brand-primary); }
.bnav-item.active::before {
    content: ''; position: absolute; top: 0; left: 25%; right: 25%;
    height: 3px; background: var(--brand-primary);
    border-radius: 0 0 3px 3px;
}
.bnav-badge {
    position: absolute; top: 6px; right: calc(50% - 18px);
    background: var(--brand-primary); color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1px 5px; border-radius: 10px;
}

/* Desktop layout */
@media (min-width: 992px) {
    .sidebar { left: 0; width: 240px; box-shadow: none; }
    .sidebar-backdrop { display: none !important; }
    .topbar { padding-left: 252px; }
    .main-wrap { margin-left: 240px; padding: 24px 32px; }
    .main-wrap.with-nav { padding-bottom: 24px; }
}

/* Page head */
.page-head { margin-bottom: 16px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--brand-secondary); margin: 0 0 4px; }
.page-sub { color: var(--text-muted); font-size: 13px; margin: 0; }
.section-title { font-size: 15px; font-weight: 600; color: var(--brand-secondary); margin: 24px 0 12px; }
.section-sub { font-size: 14px; font-weight: 600; margin: 16px 0 12px; color: var(--text); }
.back-link { color: var(--text-muted); font-size: 13px; display: inline-block; margin-bottom: 4px; }
.back-link:hover { color: var(--brand-primary); }

/* Stat grid (refine) */
.stat-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    margin-bottom: 12px;
}
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.stat-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 14px;
    display: flex; align-items: center; gap: 12px;
    color: var(--text); transition: transform 0.1s, box-shadow 0.15s;
}
a.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); color: var(--text); }
.stat-ico {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.bg-primary-soft { background: rgba(200,16,46,0.1); color: var(--brand-primary); }
.bg-success-soft { background: rgba(16,185,129,0.1); color: #059669; }
.bg-warning-soft { background: rgba(245,158,11,0.1); color: #D97706; }
.bg-danger-soft  { background: rgba(239,68,68,0.1); color: #DC2626; }
.bg-info-soft    { background: rgba(59,130,246,0.1); color: #2563EB; }
.tier-bronze-bg  { background: rgba(205,127,50,0.15); color: var(--tier-bronze); }
.tier-silver-bg  { background: rgba(166,166,166,0.2); color: #7B7B7B; }
.tier-gold-bg    { background: rgba(212,175,55,0.15); color: var(--tier-gold); }
.tier-platinum-bg{ background: rgba(93,105,117,0.15); color: var(--tier-platinum); }
.stat-meta { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-muted); margin: 0 0 2px; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.1; }

/* Panel */
.panel {
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
    margin-bottom: 12px;
}
.panel-head {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    background: #FAFAFB;
}
.panel-head h3 { font-size: 14px; font-weight: 600; margin: 0; color: var(--text); display: flex; gap: 8px; align-items: center; }
.panel-head h3 i { color: var(--brand-primary); }
.link-more { font-size: 12px; color: var(--brand-primary); }

/* Tabs */
.rr-tabs {
    display: flex; gap: 4px; overflow-x: auto;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}
.rr-tabs::-webkit-scrollbar { display: none; }
.rr-tab {
    padding: 10px 14px; font-size: 13px; font-weight: 500;
    color: var(--text-muted); white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}
.rr-tab:hover { color: var(--brand-primary); }
.rr-tab.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); font-weight: 600; }

/* Filter chips */
.filter-chips {
    display: flex; gap: 6px; overflow-x: auto;
    margin-bottom: 12px; padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
    padding: 7px 14px; font-size: 13px; font-weight: 500;
    border-radius: 20px; border: 1px solid var(--border);
    color: var(--text); background: #fff;
    white-space: nowrap; transition: all 0.15s;
}
.chip:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.chip.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }

/* Filter bar */
.filter-bar { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }

/* Reminder cards */
.reminder-list { display: grid; gap: 10px; }
@media (min-width: 768px) { .reminder-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .reminder-list { grid-template-columns: repeat(3, 1fr); } }
.reminder-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.reminder-card-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 8px;
}
.reminder-card-body { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rcb-row { display: flex; gap: 8px; align-items: center; color: var(--text); }
.rcb-row i { color: var(--text-muted); width: 16px; }
.reminder-card-actions {
    display: flex; gap: 6px; flex-wrap: wrap;
    border-top: 1px solid var(--border); padding-top: 10px;
}

/* Customer grid (mobile cards) */
.customer-grid { display: grid; gap: 10px; }
@media (min-width: 600px) { .customer-grid { grid-template-columns: repeat(2, 1fr); } }
.customer-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 14px;
    color: var(--text); display: block;
    transition: box-shadow 0.15s;
}
.customer-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); color: var(--text); }
.cc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cc-body { font-size: 13px; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.cc-body i { color: var(--text-muted); margin-right: 6px; }
.cc-stats { display: flex; gap: 12px; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; color: var(--text-muted); font-size: 12px; }
.cc-stats i { color: var(--brand-primary); }

/* Contract list */
.contract-list { list-style: none; margin: 0; padding: 0; }
.contract-list > li {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 6px;
}
.contract-list > li:last-child { border-bottom: 0; }
.cl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cl-body { font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 3px; }
.cl-body i { margin-right: 6px; }
.cl-actions { display: flex; gap: 6px; margin-top: 4px; }

/* Info list (definition) */
.info-list { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; padding: 16px; margin: 0; }
.info-list dt { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.info-list dd { margin: 0; color: var(--text); font-size: 13px; }
@media (max-width: 480px) { .info-list { grid-template-columns: 1fr; gap: 4px; } .info-list dd { margin-bottom: 8px; } }

/* History list */
.history-list { list-style: none; margin: 0; padding: 0; }
.history-list > li {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.history-list > li:last-child { border-bottom: 0; }
.hist-main { flex: 1; min-width: 0; }
.hist-main strong { display: block; font-size: 13px; color: var(--text); }
.hist-main small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }

/* Rank list (top customer) */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list > li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.rank-list > li:last-child { border-bottom: 0; }
.rank-no {
    width: 24px; height: 24px; flex-shrink: 0;
    background: var(--brand-secondary); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.rank-list > li:nth-child(1) .rank-no { background: var(--tier-gold); }
.rank-list > li:nth-child(2) .rank-no { background: var(--tier-silver); }
.rank-list > li:nth-child(3) .rank-no { background: var(--tier-bronze); }
.rank-name { flex: 1; font-size: 13px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-points { font-size: 12px; font-weight: 600; color: var(--brand-primary); }

/* Tables */
.rr-table { font-size: 13px; margin: 0; }
.rr-table thead th {
    background: #FAFAFB; border-bottom: 2px solid var(--border);
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px;
    color: var(--text-muted); font-weight: 600;
}
.rr-table tbody td { vertical-align: middle; }

/* Form grid */
.form-grid {
    display: grid; grid-template-columns: repeat(12, 1fr);
    gap: 12px; padding: 16px;
}
.form-grid > .col-12       { grid-column: span 12; }
.form-grid > .col-6        { grid-column: span 12; }
.form-grid > .col-md-3     { grid-column: span 12; }
.form-grid > .col-md-4     { grid-column: span 12; }
.form-grid > .col-md-5     { grid-column: span 12; }
.form-grid > .col-md-6     { grid-column: span 12; }
.form-grid > .col-md-7     { grid-column: span 12; }
.form-grid > .col-lg-4     { grid-column: span 12; }
.form-grid > .col-lg-6     { grid-column: span 12; }
.form-grid > .col-lg-8     { grid-column: span 12; }
@media (min-width: 768px) {
    .form-grid > .col-md-3 { grid-column: span 3; }
    .form-grid > .col-md-4 { grid-column: span 4; }
    .form-grid > .col-md-5 { grid-column: span 5; }
    .form-grid > .col-md-6 { grid-column: span 6; }
    .form-grid > .col-md-7 { grid-column: span 7; }
    .form-grid > .col-6    { grid-column: span 6; }
}
@media (min-width: 992px) {
    .form-grid > .col-lg-4 { grid-column: span 4; }
    .form-grid > .col-lg-6 { grid-column: span 6; }
    .form-grid > .col-lg-8 { grid-column: span 8; }
}

/* Modal (rr-modal) */
.rr-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 768px) { .rr-modal { align-items: center; } }
.rr-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.rr-modal-sheet {
    position: relative; background: #fff;
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    border-radius: 16px 16px 0 0; padding: 20px;
    transform: translateY(100%); transition: transform 0.25s;
}
@media (min-width: 768px) { .rr-modal-sheet { border-radius: 12px; transform: translateY(20px); margin: 0 16px; } }
.rr-modal.open .rr-modal-sheet { transform: translateY(0); }
.rr-modal-sheet h5 { font-size: 16px; font-weight: 600; margin: 0 0 12px; color: var(--brand-secondary); }

/* Toast */
.toast-host { position: fixed; top: 70px; right: 16px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.toast-item {
    background: #fff; border-radius: 10px;
    padding: 12px 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-left: 3px solid var(--brand-secondary);
    display: flex; gap: 8px; align-items: flex-start;
    font-size: 13px; transform: translateX(120%);
    transition: transform 0.25s ease-out;
    color: var(--text);
}
.toast-item.show { transform: translateX(0); }
.toast-item i { font-size: 18px; flex-shrink: 0; }
.toast-success { border-left-color: #10B981; }
.toast-success i { color: #10B981; }
.toast-error { border-left-color: #EF4444; }
.toast-error i { color: #EF4444; }
.toast-warning { border-left-color: #F59E0B; }
.toast-warning i { color: #F59E0B; }
.toast-info { border-left-color: #3B82F6; }
.toast-info i { color: #3B82F6; }

/* Badges (refine) */
.badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; }
.badge-tier-bronze   { background: rgba(205,127,50,0.15); color: var(--tier-bronze); }
.badge-tier-silver   { background: rgba(166,166,166,0.2); color: #6B6B6B; }
.badge-tier-gold     { background: rgba(212,175,55,0.15); color: #B8860B; }
.badge-tier-platinum { background: rgba(93,105,117,0.15); color: var(--tier-platinum); }
.badge-success { background: rgba(16,185,129,0.12); color: #047857; }
.badge-warning { background: rgba(245,158,11,0.15); color: #B45309; }
.badge-danger  { background: rgba(239,68,68,0.12); color: #B91C1C; }
.badge-info    { background: rgba(59,130,246,0.12); color: #1D4ED8; }
.badge-neutral { background: #F3F4F6; color: #4B5563; }

/* Buttons */
.btn-wa { background: #25D366; color: #fff; border: 0; }
.btn-wa:hover { background: #1FB855; color: #fff; }

/* Login (refine) */
.login-bg {
    min-height: 100vh; background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-secondary-light) 100%);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
    background: #fff; border-radius: 16px; padding: 32px 24px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.brand-circle {
    width: 64px; height: 64px; margin: 0 auto 12px;
    background: var(--brand-primary); color: #fff;
    border-radius: 16px; display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 800;
    box-shadow: 0 8px 24px rgba(200,16,46,0.3);
}
.login-brand h1 { font-size: 24px; font-weight: 700; color: var(--brand-secondary); margin: 0; }
.login-sub { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.login-footer { text-align: center; margin: 24px 0 0; color: var(--text-muted); font-size: 12px; }

/* Pager */
.rr-pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 16px 0; }
.rr-pager span { font-size: 13px; color: var(--text-muted); }

/* Report card */
.report-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 20px; height: 100%;
    display: flex; flex-direction: column; gap: 10px;
}
.report-card .rep-ico {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.report-card h4 { font-size: 16px; margin: 0; color: var(--brand-secondary); font-weight: 600; }
.report-card .btn { margin-top: auto; }

/* More grid (mobile menu page) */
.more-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
    margin-bottom: 16px;
}
@media (min-width: 600px) { .more-grid { grid-template-columns: repeat(3, 1fr); } }
.more-card {
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px; padding: 20px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--text); transition: all 0.15s;
}
.more-card:hover { border-color: var(--brand-primary); color: var(--brand-primary); transform: translateY(-1px); }
.more-card i { font-size: 28px; color: var(--brand-primary); }
.more-card span { font-size: 13px; font-weight: 600; text-align: center; }

/* =====================================================
   v2.0 — APPENDED: FAB, Stepper, Helper Text, Onboarding
   ===================================================== */

/* FAB - Floating Action Button (mobile) */
.fab-container {
    position: fixed;
    bottom: 80px; right: 16px;
    z-index: 60;
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 12px;
}
.fab-main {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    border: 0;
    box-shadow: 0 4px 16px rgba(200,16,46,0.3);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.fab-main:active { transform: scale(0.95); }
.fab-main.open { transform: rotate(45deg); }
.fab-menu {
    display: flex; flex-direction: column;
    gap: 10px;
    opacity: 0; transform: translateY(20px); pointer-events: none;
    transition: all 0.2s;
}
.fab-menu.open { opacity: 1; transform: translateY(0); pointer-events: all; }
.fab-item {
    display: flex; align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.fab-label {
    background: #fff; color: var(--text);
    padding: 8px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 500;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    white-space: nowrap;
}
.fab-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--brand-secondary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(26,43,76,0.3);
}

/* STEPPER (Wizard) */
.stepper {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 8px; margin-bottom: 16px;
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
}
.step {
    display: flex; flex-direction: column; align-items: center;
    gap: 6px; min-width: 60px; flex: 1;
    color: var(--text-muted); font-size: 12px;
    position: relative;
    text-align: center;
}
.step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #E5E7EB; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    transition: all 0.2s;
}
.step.active .step-num {
    background: var(--brand-primary); color: #fff;
    box-shadow: 0 2px 8px rgba(200,16,46,0.3);
}
.step.done .step-num {
    background: #10B981; color: #fff;
}
.step.done .step-num::before { content: '✓'; }
.step.active { color: var(--text); font-weight: 600; }
.step.done { color: #059669; }
.step + .step::before {
    content: ''; position: absolute;
    left: -50%; top: 16px;
    width: 100%; height: 2px;
    background: #E5E7EB;
    z-index: -1;
}
.step.done + .step::before, .step.active + .step::before { background: #10B981; }

/* HELPER TEXT (form hint) */
.helper-text {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}
.helper-text i { margin-right: 4px; color: var(--brand-secondary); }

/* QUICK START CARDS (Dashboard onboarding) */
.quickstart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); gap: 10px;
    margin: 16px 0;
}
@media (min-width: 768px) {
    .quickstart-grid { grid-template-columns: repeat(4, 1fr); }
}
.quickstart-card {
    display: flex; flex-direction: column; gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, #fff 0%, #FAFAFB 100%);
    border: 1px solid var(--border); border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s;
    position: relative; overflow: hidden;
}
.quickstart-card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    color: var(--text);
}
.quickstart-card::before {
    content: ''; position: absolute;
    top: 0; right: 0;
    width: 60px; height: 60px;
    background: radial-gradient(circle, var(--brand-primary) 0%, transparent 70%);
    opacity: 0.05;
}
.qs-step { font-size: 11px; font-weight: 700; color: var(--brand-primary); text-transform: uppercase; letter-spacing: 0.5px; }
.qs-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.qs-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.qs-icon { font-size: 20px; color: var(--brand-secondary); }

/* ALERT-INFO (for explainer boxes on reminders, sync, etc) */
.alert-explain {
    background: #EFF6FF;
    border-left: 4px solid #3B82F6;
    color: #1E40AF;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.alert-explain i { margin-right: 6px; }
.alert-explain strong { color: #1E3A8A; }

/* SECTION SPACING + page-head v2 */
.page-head {
    display: flex; flex-direction: column; gap: 4px;
    margin-bottom: 16px;
}
.page-head .page-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-top: 8px;
}
@media (min-width: 768px) {
    .page-head { flex-direction: row; align-items: flex-start; justify-content: space-between; }
    .page-head .page-info { flex: 1; }
    .page-head .page-actions { margin-top: 0; }
}

/* MOBILE FRIENDLY TWEAKS */
.btn { min-height: 38px; }
@media (max-width: 767px) {
    .btn-lg { min-height: 48px; font-size: 16px; }
    input.form-control, select.form-select, textarea.form-control { font-size: 16px; min-height: 44px; }
    /* Avoid iOS zoom on focus */
}
.form-label { font-weight: 500; font-size: 13px; margin-bottom: 4px; }

/* SECTION DIVIDER */
.section-divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
    position: relative;
}
.section-divider span {
    position: absolute; left: 50%; top: -10px;
    transform: translateX(-50%);
    background: var(--bg);
    padding: 0 12px;
    font-size: 11px; color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* CUSTOMER PORTAL — public-facing */
body.portal-page {
    background: linear-gradient(180deg, var(--brand-secondary) 0%, var(--brand-secondary-light) 200px, #F3F4F6 200px);
    min-height: 100vh;
    margin: 0; padding: 0;
}
.portal-wrap { max-width: 600px; margin: 0 auto; padding: 24px 16px 80px; }
.portal-header {
    color: #fff; padding: 20px 4px 32px;
}
.portal-header .portal-brand {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 20px;
}
.portal-header .portal-brand .brand-circle {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--brand-primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.portal-header h1 { color: #fff; margin: 0; font-size: 16px; font-weight: 700; }
.portal-header .portal-sub { font-size: 12px; opacity: 0.8; margin: 0; }
.portal-greeting { font-size: 22px; font-weight: 700; line-height: 1.2; margin-bottom: 6px; }
.portal-tier {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
}
.portal-card {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 12px;
}
.portal-card h3 {
    font-size: 14px; font-weight: 600; color: var(--brand-secondary);
    margin: 0 0 12px;
    display: flex; align-items: center; gap: 8px;
}
.portal-card h3 i { color: var(--brand-primary); }
.portal-stat {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 4px; text-align: center;
    padding-top: 8px; border-top: 1px dashed var(--border);
}
.portal-stat-item .ps-value { font-size: 18px; font-weight: 700; color: var(--brand-secondary); }
.portal-stat-item .ps-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.portal-action-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
    margin: 16px 0;
}
.portal-action-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px;
    background: #fff; border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
    font-size: 12px; font-weight: 500;
    text-align: center;
}
.portal-action-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.portal-action-btn i { font-size: 22px; color: var(--brand-primary); }
.portal-action-btn.primary { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.portal-action-btn.primary i { color: #fff; }
.portal-action-btn.wa { background: #25D366; color: #fff; border-color: #25D366; }
.portal-action-btn.wa i { color: #fff; }

/* TIMELINE for portal */
.portal-timeline { list-style: none; margin: 0; padding: 0; }
.portal-timeline li {
    display: flex; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.portal-timeline li:last-child { border-bottom: 0; }
.pt-icon {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 8px;
    background: rgba(200,16,46,0.1); color: var(--brand-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.pt-icon.green { background: rgba(16,185,129,0.1); color: #059669; }
.pt-icon.amber { background: rgba(245,158,11,0.1); color: #D97706; }
.pt-content { flex: 1; min-width: 0; }
.pt-title { font-size: 13px; font-weight: 500; }
.pt-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pt-amount { font-size: 13px; font-weight: 600; color: var(--brand-primary); white-space: nowrap; }

/* ONBOARDING MODAL */
.onboard-modal-content { max-width: 500px; }
.onboard-step { display: none; }
.onboard-step.active { display: block; }
.onboard-illustration {
    width: 80px; height: 80px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    box-shadow: 0 8px 20px rgba(200,16,46,0.3);
}
.onboard-progress {
    display: flex; gap: 4px; justify-content: center;
    margin: 12px 0;
}
.onboard-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--border);
    transition: all 0.2s;
}
.onboard-dot.active { background: var(--brand-primary); width: 24px; border-radius: 4px; }

/* REMINDER LIST WITH STATUS */
.reminder-status-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 12px;
    font-size: 11px; font-weight: 600;
}
.reminder-status-pill.urgent { background: rgba(239,68,68,0.1); color: #B91C1C; }
.reminder-status-pill.warning { background: rgba(245,158,11,0.1); color: #B45309; }
.reminder-status-pill.normal { background: rgba(59,130,246,0.1); color: #1D4ED8; }

/* COMPACT TABLES → CARDS on mobile */
@media (max-width: 991px) {
    .table-as-cards thead { display: none; }
    .table-as-cards tbody, .table-as-cards tr, .table-as-cards td { display: block; }
    .table-as-cards tr {
        background: #fff; border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 8px;
        padding: 12px 14px;
    }
    .table-as-cards td {
        padding: 4px 0;
        border: 0;
    }
    .table-as-cards td[data-label]::before {
        content: attr(data-label) ': ';
        font-weight: 600;
        color: var(--text-muted);
        font-size: 12px;
    }
}

/* ALERT - "Mulai dari sini" untuk dashboard kosong */
.empty-onboard {
    background: linear-gradient(135deg, #FEF3F2 0%, #FFF5F5 100%);
    border: 1px solid rgba(200,16,46,0.2);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    margin: 16px 0 24px;
}
.empty-onboard i { font-size: 48px; color: var(--brand-primary); display: block; margin-bottom: 8px; }
.empty-onboard h2 { font-size: 18px; font-weight: 700; color: var(--brand-secondary); margin: 0 0 6px; }
.empty-onboard p { color: var(--text-muted); margin: 0 0 16px; font-size: 14px; }

/* TILE ACTION (large clickable card) */
.tile-action {
    display: flex; align-items: center; gap: 14px;
    padding: 16px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    color: var(--text); text-decoration: none;
    transition: all 0.15s;
}
.tile-action:hover {
    border-color: var(--brand-primary);
    background: #FEF3F2;
    color: var(--text);
}
.tile-action .tile-ico {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: rgba(200,16,46,0.1);
    color: var(--brand-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.tile-action .tile-body { flex: 1; min-width: 0; }
.tile-action .tile-title { font-size: 14px; font-weight: 600; }
.tile-action .tile-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tile-action .tile-arrow { color: var(--text-muted); font-size: 16px; }

/* WHATSAPP PREVIEW BOX */
.wa-preview {
    background: #DCF8C6;
    border-radius: 12px 12px 12px 0;
    padding: 12px 14px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.wa-preview-header {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex; align-items: center; gap: 4px;
}
.wa-preview-header i { color: #25D366; }

/* COUNTDOWN PILL */
.countdown-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px; font-weight: 600;
}
.countdown-pill.danger  { background: #FEE2E2; color: #B91C1C; }
.countdown-pill.warning { background: #FEF3C7; color: #B45309; }
.countdown-pill.success { background: #D1FAE5; color: #059669; }
.countdown-pill.muted   { background: #F3F4F6; color: #6B7280; }


/* ===== v2.1 Friendly UI additions ===== */
.stat-card .stat-hint {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
  font-weight: 400;
}
.stat-card:hover .stat-hint { color: var(--brand-primary, #1A2B4C); }

/* Brand-aware accent helpers */
.tile-action:hover { border-color: var(--brand-accent, #C9A96E) !important; }

/* v2.1.1 Portal access badge in customer card */
.cc-portal-badge {
  background: #e3f2fd;
  color: #0d47a1;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* v2.2 Primary CTA in sidebar */
.sidebar-nav .nav-cta {
  background: var(--brand-accent, #C9A96E) !important;
  color: var(--brand-primary, #1A2B4C) !important;
  margin: 8px 12px !important;
  border-radius: 10px !important;
  font-weight: 700;
  text-align: left;
  padding: 12px 14px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.sidebar-nav .nav-cta:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}
.sidebar-nav .nav-cta i {
  font-size: 18px;
}

/* Bottom-nav CTA spotlight middle button */
.bottom-nav .bn-cta {
  background: var(--brand-accent, #C9A96E);
  color: var(--brand-primary, #1A2B4C);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  margin-top: -16px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
  flex-shrink: 0;
}
.bottom-nav .bn-cta span { display: none; }

/* v2.2 Customer Portal Status */
.portal-status-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.psr-label { font-size: 11px; color: #6B7280; text-transform: uppercase; font-weight: 600; letter-spacing: .5px; }
.psr-value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.psr-value-sm { font-size: 14px; font-weight: 600; }
.portal-status-active   { border-left: 4px solid #28a745; }
.portal-status-warning  { border-left: 4px solid #ffc107; background: #fffbf0; }
.portal-status-expired  { border-left: 4px solid #dc3545; background: #fff5f5; }
.portal-status-inactive { border-left: 4px solid #6c757d; }

/* v2.3 — Customer Requests styling */
.nav-tabs-mobile { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; border-bottom: 1px solid #e0e0e0; }
.nav-tabs-mobile .nav-item { flex-shrink: 0; }
.nav-tabs-mobile .nav-link { white-space: nowrap; padding: 8px 14px; font-size: 13px; }
.nav-tabs-mobile .nav-link.active { font-weight: 700; }

/* v2.3.2 — Tab badge for customer detail */
.rr-tab { position: relative; }
.rr-tab-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  background: #f44336;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  line-height: 1.4;
  min-width: 16px;
  text-align: center;
}
@media (max-width: 575px) {
  .rr-tab-badge {
    top: 2px;
    right: 2px;
    padding: 0 4px;
    font-size: 9px;
  }
}
