/* ============================================================
   Fidelity Card Manager - Professional Design System
   ============================================================ */

:root {
    --fc-primary: #4F266C;
    --fc-primary-light: #6b3d8a;
    --fc-primary-dark: #3a1b50;
    --fc-secondary: #0ea5e9;
    --fc-success: #10b981;
    --fc-warning: #f59e0b;
    --fc-danger: #ef4444;
    --fc-dark: #040603;
    --fc-gray-50: #ffffff;
    --fc-gray-100: #f1f5f9;
    --fc-gray-200: #e2e8f0;
    --fc-gray-300: #cbd5e1;
    --fc-gray-400: #94a3b8;
    --fc-gray-500: #64748b;
    --fc-gray-600: #475569;
    --fc-gray-700: #334155;
    --fc-gray-800: #1e293b;
    --fc-gray-900: #0f172a;
    --fc-radius: 12px;
    --fc-radius-lg: 16px;
    --fc-radius-xl: 24px;
    --fc-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --fc-shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --fc-shadow-lg: 0 10px 25px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
    --fc-shadow-xl: 0 20px 50px -12px rgba(0,0,0,.15);
    --fc-transition: all .25s cubic-bezier(.4,0,.2,1);
    --fc-transition-fast: all .15s cubic-bezier(.4,0,.2,1);
    --fc-transition-slow: all .4s cubic-bezier(.4,0,.2,1);
    --fc-gradient: linear-gradient(135deg, #4F266C, #6b3d8a);
    --fc-gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
    --fc-gradient-cool: linear-gradient(135deg, #06b6d4, #8b5cf6);
    --fc-blur: blur(20px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Global ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: 'Poppins', sans-serif;
    background: #ffffff;
    color: #281A2E;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---- Animated Background ---- */
.fc-bg-animated {
    position: fixed; inset: 0; z-index: -1;
    background: #ffffff;
}
.fc-bg-animated::before {
    content: ''; position: absolute; inset: 0;
    background: none;
}
@keyframes bgShift {
    0% { opacity: .6; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* ---- Cards ---- */
.fc-card {
    background: #fff;
    border: 1px solid var(--fc-gray-200);
    border-radius: var(--fc-radius-lg);
    box-shadow: var(--fc-shadow-sm);
    transition: var(--fc-transition);
    overflow: visible;
    position: relative;
}
.fc-card:hover {
    box-shadow: var(--fc-shadow-lg);
}
.fc-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--fc-gray-100);
    font-weight: 600;
    font-size: .9rem;
    color: var(--fc-gray-700);
    display: flex; align-items: center; gap: 8px;
}
.fc-card-body { padding: 20px; }
.fc-card-body.p-0 { padding: 0; }

/* ---- Stat Cards ---- */
.fc-stat {
    background: #fff;
    border: 1px solid var(--fc-gray-200);
    border-radius: var(--fc-radius-lg);
    padding: 20px;
    text-align: center;
    transition: var(--fc-transition);
    position: relative;
    overflow: hidden;
}
.fc-stat::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--fc-gradient);
    opacity: 0; transition: var(--fc-transition-fast);
}
.fc-stat:hover { transform: translateY(-3px); box-shadow: var(--fc-shadow-lg); }
.fc-stat:hover::before { opacity: 1; }
.fc-stat-value {
    font-size: 2rem; font-weight: 800;
    background: var(--fc-gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
    line-height: 1.2;
}
.fc-stat-value.green { background: linear-gradient(135deg, #10b981, #059669); -webkit-background-clip: text; background-clip: text; }
.fc-stat-value.amber { background: var(--fc-gradient-warm); -webkit-background-clip: text; background-clip: text; }
.fc-stat-value.blue  { background: linear-gradient(135deg, #0ea5e9, #6366f1); -webkit-background-clip: text; background-clip: text; }
.fc-stat-label {
    font-size: .78rem; color: var(--fc-gray-500);
    text-transform: uppercase; letter-spacing: .5px;
    margin-top: 4px; font-weight: 500;
}
.fc-stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 10px;
}

/* ---- Buttons ---- */
.fc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: 10px;
    font-weight: 600; font-size: .875rem;
    border: none; cursor: pointer;
    transition: var(--fc-transition-fast);
    text-decoration: none; white-space: nowrap;
    line-height: 1.2; font-family: inherit;
}
.fc-btn:active { transform: scale(.97); }
.fc-btn-primary {
    background: #4F266C; color: #FEC605;
    box-shadow: 0 4px 14px rgba(79,38,108,.3);
}
.fc-btn-primary:hover { box-shadow: 0 6px 20px rgba(79,38,108,.4); color: #FEC605; }
.fc-btn-success {
    background: #4F266C; color: #FEC605;
    box-shadow: 0 4px 14px rgba(79,38,108,.3);
}
.fc-btn-success:hover { box-shadow: 0 6px 20px rgba(79,38,108,.4); color: #FEC605; }
.fc-btn-danger {
    background: #4F266C; color: #FEC605;
    box-shadow: 0 4px 14px rgba(79,38,108,.3);
}
.fc-btn-danger:hover { box-shadow: 0 6px 20px rgba(79,38,108,.4); color: #FEC605; }
.fc-btn-warning {
    background: #4F266C; color: #FEC605;
    box-shadow: 0 4px 14px rgba(79,38,108,.3);
}
.fc-btn-ghost {
    background: #fff; color: var(--fc-gray-600);
    border: 1.5px solid var(--fc-gray-200);
}
.fc-btn-ghost:hover { background: var(--fc-gray-100); color: var(--fc-gray-800); }
.fc-btn-sm { padding: 7px 14px; font-size: .8rem; border-radius: 8px; }
.fc-btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: 12px; }
.fc-btn-icon {
    width: 36px; height: 36px; padding: 0;
    border-radius: 8px; display: inline-flex;
    align-items: center; justify-content: center;
    font-size: .9rem; border: 1.5px solid var(--fc-gray-200);
    background: #fff; color: var(--fc-gray-600);
    cursor: pointer; transition: var(--fc-transition-fast);
    text-decoration: none; flex-shrink: 0;
}
.fc-btn-icon:hover { background: var(--fc-gray-100); color: var(--fc-primary); border-color: var(--fc-primary-light); }
.fc-btn-icon.sm { width: 32px; height: 32px; font-size: .82rem; border-radius: 7px; }
.fc-btn-group { display: inline-flex; gap: 4px; align-items: center; }

/* ---- Forms ---- */
.fc-input {
    border: 1.5px solid var(--fc-gray-200);
    border-radius: 10px; padding: 10px 14px;
    font-size: .9rem; transition: var(--fc-transition-fast);
    background: #fff; width: 100%;
    box-sizing: border-box;
    min-width: 0;
    font-family: inherit;
}
.fc-input:focus {
    outline: none; border-color: var(--fc-primary-light);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.fc-select {
    border: 1.5px solid var(--fc-gray-200);
    border-radius: 10px; padding: 10px 14px;
    font-size: .9rem; background: #fff;
    transition: var(--fc-transition-fast);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    font-family: inherit;
}
.fc-select:focus {
    outline: none; border-color: var(--fc-primary-light);
    box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.fc-label {
    font-size: .8rem; font-weight: 600;
    color: var(--fc-gray-600); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .3px;
}

/* ---- Tables ---- */
.fc-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.fc-table thead th {
    font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
    color: var(--fc-gray-500); padding: 12px 16px;
    border-bottom: 1px solid var(--fc-gray-200);
    background: var(--fc-gray-50);
}
.fc-table tbody td {
    padding: 12px 16px; border-bottom: 1px solid var(--fc-gray-100);
    font-size: .875rem; vertical-align: middle;
    transition: var(--fc-transition-fast);
}
.fc-table tbody tr { transition: var(--fc-transition-fast); }
.fc-table tbody tr:hover { background: rgba(79,70,229,.02); }
.fc-table tbody tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.fc-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 20px;
    font-size: .72rem; font-weight: 600;
    letter-spacing: .3px; text-transform: uppercase;
}
.fc-badge-earn { background: #d1fae5; color: #065f46; }
.fc-badge-redeem { background: #fee2e2; color: #991b1b; }
.fc-badge-reward { background: #fef3c7; color: #92400e; }
.fc-badge-adjust { background: #e0e7ff; color: #3730a3; }
.fc-badge-active { background: #d1fae5; color: #065f46; }
.fc-badge-inactive { background: var(--fc-gray-200); color: var(--fc-gray-600); }
.fc-badge-voucher { background: #fce7f3; color: #9d174d; }
.fc-badge-points {
    background: linear-gradient(135deg, var(--fc-primary), var(--fc-secondary));
    color: #fff; font-size: .8rem; padding: 4px 12px;
}

/* ---- Alerts / Toast ---- */
.fc-toast {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    min-width: 300px; max-width: 420px;
    padding: 16px 20px; border-radius: var(--fc-radius);
    background: #fff; box-shadow: var(--fc-shadow-xl);
    border-left: 4px solid var(--fc-primary);
    animation: toastIn .4s cubic-bezier(.4,0,.2,1);
    display: flex; align-items: center; gap: 12px;
}
.fc-toast.success { border-left-color: var(--fc-success); }
.fc-toast.danger { border-left-color: var(--fc-danger); }
.fc-toast.warning { border-left-color: var(--fc-warning); }
.fc-toast-exit { animation: toastOut .3s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ---- Admin Layout ---- */
.fc-admin-shell { display: flex; min-height: 100vh; }

.fc-sidebar {
    width: 260px; background: #040603;
    color: #fff; display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 1000; transition: var(--fc-transition-slow);
    overflow-y: auto;
}
.fc-sidebar-brand {
    padding: 20px 24px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.fc-sidebar-brand-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: #4F266C;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
}
.fc-sidebar-brand-text { font-weight: 700; font-size: 1rem; }
.fc-sidebar-brand-sub { font-size: .7rem; color: rgba(255,255,255,.5); }

.fc-sidebar-nav { padding: 12px; flex: 1; }
.fc-sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; border-radius: 10px;
    color: rgba(255,255,255,.65); font-size: .875rem;
    font-weight: 500; text-decoration: none;
    transition: var(--fc-transition-fast);
    margin-bottom: 2px;
}
.fc-sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.fc-sidebar-link.active {
    background: rgba(79,38,108,.4); color: #FEC605;
    box-shadow: 0 2px 8px rgba(79,38,108,.3);
}
.fc-sidebar-link i { font-size: 1.1rem; width: 22px; text-align: center; }
.fc-sidebar-section {
    font-size: .68rem; text-transform: uppercase; letter-spacing: 1px;
    color: rgba(255,255,255,.3); padding: 16px 16px 8px;
    font-weight: 600;
}
.fc-sidebar-footer {
    padding: 16px; border-top: 1px solid rgba(255,255,255,.08);
}

.fc-main {
    flex: 1; margin-left: 260px;
    padding: 24px 32px;
    transition: var(--fc-transition-slow);
    min-height: 100vh;
}

/* ---- Mobile Sidebar ---- */
.fc-sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 999;
    backdrop-filter: var(--fc-blur);
    -webkit-backdrop-filter: var(--fc-blur);
    opacity: 0; transition: opacity .3s;
}
.fc-sidebar-overlay.show { display: block; opacity: 1; }

.fc-mobile-header {
    display: none; position: sticky; top: 0; z-index: 100;
    background: #040603;
    backdrop-filter: var(--fc-blur);
    -webkit-backdrop-filter: var(--fc-blur);
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 12px 16px;
    color: #fff;
}

@media (max-width: 991px) {
    .fc-sidebar { transform: translateX(-100%); width: 280px; }
    .fc-sidebar.open { transform: translateX(0); }
    .fc-main { margin-left: 0; padding: 16px; }
    .fc-mobile-header { display: flex; align-items: center; justify-content: space-between; }
}

/* ---- Page Transitions ---- */
.fc-page-enter {
    animation: pageIn .35s cubic-bezier(.4,0,.2,1);
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Stamp Card (Customer View) ---- */
.fc-fidelity-card {
    max-width: 400px; margin: 0 auto;
    border-radius: var(--fc-radius-xl);
    overflow: hidden;
    box-shadow: var(--fc-shadow-xl);
    position: relative;
}
.fc-fidelity-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 50%);
    pointer-events: none;
}
.fc-fidelity-header {
    padding: 28px 24px 16px; text-align: center;
}
.fc-fidelity-stamps {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 10px; padding: 0 24px 20px;
}
.fc-stamp {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 700;
    transition: var(--fc-transition);
}
.fc-stamp-filled {
    background: rgba(255,255,255,.25);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    animation: stampPop .3s cubic-bezier(.4,0,.2,1);
}
.fc-stamp-empty {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.3);
    border: 1.5px dashed rgba(255,255,255,.2);
}
@keyframes stampPop {
    0% { transform: scale(0); } 60% { transform: scale(1.15); } 100% { transform: scale(1); }
}
.fc-fidelity-footer {
    background: rgba(0,0,0,.1); padding: 16px 24px;
    text-align: center;
}

/* ---- QR Scanner ---- */
.fc-scanner-container {
    position: relative; border-radius: var(--fc-radius-lg);
    overflow: hidden; background: #000;
    max-width: 360px; margin: 0 auto;
    aspect-ratio: 1;
}
.fc-scanner-container video {
    width: 100%; height: 100%; object-fit: cover;
}
.fc-scanner-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
}
.fc-scanner-frame {
    width: 200px; height: 200px;
    border: 2px solid rgba(255,255,255,.6);
    border-radius: 16px; position: relative;
    box-shadow: 0 0 0 9999px rgba(0,0,0,.4);
}
.fc-scanner-line {
    position: absolute; left: 4px; right: 4px; height: 2px;
    background: var(--fc-primary-light);
    box-shadow: 0 0 12px var(--fc-primary-light);
    animation: scanLine 2s ease-in-out infinite;
}
@keyframes scanLine {
    0%, 100% { top: 4px; } 50% { top: calc(100% - 6px); }
}

/* ---- Modal ---- */
.fc-modal-backdrop {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0,0,0,.5);
    backdrop-filter: var(--fc-blur);
    -webkit-backdrop-filter: var(--fc-blur);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn .2s;
}
.fc-modal {
    background: #fff; border-radius: var(--fc-radius-xl);
    box-shadow: var(--fc-shadow-xl);
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    animation: modalIn .3s cubic-bezier(.4,0,.2,1);
}
.fc-modal-header {
    padding: 20px 24px; border-bottom: 1px solid var(--fc-gray-100);
    display: flex; align-items: center; justify-content: space-between;
}
.fc-modal-body { padding: 24px; }
.fc-modal-footer {
    padding: 16px 24px; border-top: 1px solid var(--fc-gray-100);
    display: flex; justify-content: flex-end; gap: 8px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ---- Quick Action Buttons ---- */
.fc-quick-actions {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.fc-quick-action {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    padding: 20px 12px; border-radius: var(--fc-radius-lg);
    background: #fff; border: 1.5px solid var(--fc-gray-200);
    cursor: pointer; transition: var(--fc-transition);
    text-decoration: none; color: var(--fc-gray-700);
    font-weight: 600; font-size: .85rem;
    font-family: inherit;
}
.fc-quick-action:hover {
    border-color: var(--fc-primary-light);
    box-shadow: var(--fc-shadow);
    transform: translateY(-2px);
    color: var(--fc-primary);
}
.fc-quick-action-icon {
    width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
}

/* ---- Chart Container ---- */
.fc-chart-container {
    position: relative; height: 260px;
    padding: 8px 0;
}

/* ---- Customer Public Page ---- */
.fc-public-shell {
    min-height: 100vh; display: flex; flex-direction: column;
    overflow-x: hidden;
}
.fc-public-header {
    background: #040603;
    backdrop-filter: var(--fc-blur);
    -webkit-backdrop-filter: var(--fc-blur);
    border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 14px 0; position: sticky; top: 0; z-index: 100;
}
.fc-public-header a { color: #fff !important; }
.fc-public-header a:hover { color: #FEC605 !important; }

/* ---- Skeleton Loading ---- */
.fc-skeleton {
    background: linear-gradient(90deg, var(--fc-gray-100) 25%, var(--fc-gray-200) 50%, var(--fc-gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---- Misc ---- */
.fc-divider { height: 1px; background: var(--fc-gray-200); margin: 20px 0; }
.fc-empty-state { text-align: center; padding: 48px 24px; color: var(--fc-gray-400); }
.fc-empty-state i { font-size: 3rem; margin-bottom: 12px; display: block; }
.fc-count-up { display: inline-block; }
.fc-fade-in { animation: fadeIn .4s ease; }
.fc-slide-up { animation: pageIn .4s ease; }

/* ---- Mobile Bottom Nav (Public) ---- */
.fc-bottom-bar {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: #040603;
    backdrop-filter: var(--fc-blur);
    -webkit-backdrop-filter: var(--fc-blur);
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 8px 0 calc(8px + var(--safe-bottom));
    z-index: 100;
}
@media (max-width: 767px) {
    .fc-bottom-bar { display: flex; justify-content: space-around; }
    .fc-public-shell { padding-bottom: calc(70px + var(--safe-bottom)); }
}
.fc-bottom-bar a {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; font-size: .68rem; color: rgba(255,255,255,.6);
    text-decoration: none; padding: 4px 12px;
    transition: var(--fc-transition-fast);
}
.fc-bottom-bar a.active, .fc-bottom-bar a:hover { color: #FEC605; }
.fc-bottom-bar a i { font-size: 1.3rem; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fc-gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--fc-gray-400); }

/* ---- Form Grid Fix ---- */
.fc-form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1.5fr auto;
    gap: 12px;
    align-items: end;
}
@media (max-width: 991px) {
    .fc-form-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 575px) {
    .fc-form-grid {
        grid-template-columns: 1fr;
    }
    .fc-form-grid button { width: 100%; }
}

/* ---- Pagination ---- */
.fc-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-top: 1px solid var(--fc-gray-100);
    font-size: .82rem; color: var(--fc-gray-500);
    flex-wrap: wrap; gap: 8px;
}
.fc-pagination-pages { display: flex; gap: 4px; align-items: center; }
.fc-pagination-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 32px; height: 32px; padding: 0 8px;
    border-radius: 8px; border: 1.5px solid var(--fc-gray-200);
    background: #fff; color: var(--fc-gray-600);
    font-size: .8rem; font-weight: 600; cursor: pointer;
    transition: var(--fc-transition-fast); text-decoration: none;
    font-family: inherit;
}
.fc-pagination-btn:hover { border-color: var(--fc-primary-light); color: var(--fc-primary); background: #eef2ff; }
.fc-pagination-btn.active { background: var(--fc-primary); color: #fff; border-color: var(--fc-primary); }
.fc-pagination-btn:disabled, .fc-pagination-btn.disabled {
    opacity: .4; cursor: not-allowed; pointer-events: none;
}

/* ---- Customer Search Autocomplete ---- */
.fc-autocomplete { position: relative; z-index: 100; }
.fc-autocomplete-list {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 9999;
    background: #fff; border: 1.5px solid var(--fc-gray-200);
    border-top: none; border-radius: 0 0 10px 10px;
    box-shadow: var(--fc-shadow-lg); max-height: 240px;
    overflow-y: auto; display: none;
}
.fc-autocomplete-list.open { display: block; }
.fc-card:has(.fc-autocomplete-list.open) { z-index: 500; }
.fc-autocomplete-item {
    padding: 10px 14px; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    transition: var(--fc-transition-fast);
    border-bottom: 1px solid var(--fc-gray-50);
    font-size: .85rem;
}
.fc-autocomplete-item:hover, .fc-autocomplete-item.selected { background: #eef2ff; }
.fc-autocomplete-item:last-child { border-bottom: none; }
.fc-autocomplete-avatar {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--fc-gradient); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .75rem; flex-shrink: 0;
}
.fc-autocomplete-info { flex: 1; min-width: 0; }
.fc-autocomplete-name { font-weight: 600; color: var(--fc-gray-800); }
.fc-autocomplete-meta { font-size: .75rem; color: var(--fc-gray-400); }


/* ---- View Customer Responsive Grid ---- */
.fc-view-customer-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 16px;
    align-items: start;
}
@media (max-width: 767px) {
    .fc-view-customer-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Form Row ---- */
.fc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 575px) {
    .fc-form-row {
        grid-template-columns: 1fr;
    }
}

/* ---- Points / Operators form responsive ---- */
@media (max-width: 767px) {
    .fc-form-grid,
    .fc-form-grid[style] {
        grid-template-columns: 1fr !important;
    }
    .fc-form-grid button,
    .fc-form-grid .fc-btn {
        width: 100%;
    }
}

/* ---- Stamp Card (generated) ---- */
.fc-stamp-card {
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    overflow: hidden;
    word-break: break-word;
    box-sizing: border-box;
}
.fc-stamp-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin: 14px 0;
}
.fc-sg-item {
    width: calc((100% - 18px) / 7); /* 7 cols, 6 gaps of 3px */
    min-width: 0;
    border-radius: 6px;
    padding: 4px 0;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.fc-sg-filled {
    background: rgba(255,255,255,.3);
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.fc-sg-empty {
    background: rgba(255,255,255,.08);
    outline: 1.5px dashed rgba(255,255,255,.2);
    outline-offset: -1.5px;
    font-weight: 600;
    color: rgba(255,255,255,.5);
}
.fc-sg-icon { font-size: .75rem; line-height: 1; }
.fc-sg-val  { font-size: .6rem; line-height: 1.2; }

@media (max-width: 374px) {
    .fc-stamp-card { padding: 16px 6px; }
    .fc-sg-item { width: calc((100% - 18px) / 7); }
    .fc-sg-val  { font-size: .55rem; }
}

/* ---- Force everything inside viewport on mobile ---- */
img, table, pre, code, .fc-stat, .fc-stamp-card { max-width: 100%; box-sizing: border-box; }

.fc-card {
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .fc-stat { padding: 12px 8px; min-width: 0; }
    .fc-stat-value { font-size: 1.2rem !important; }
    .fc-stat-label { font-size: .68rem; }
    .fc-table thead th,
    .fc-table tbody td { padding: 8px 10px; font-size: .78rem; }
    .fc-badge { font-size: .65rem; padding: 3px 6px; }
    .fc-card-header { padding: 12px 14px; font-size: .82rem; }
}

@media (max-width: 480px) {
    #tblPublicHistory { table-layout: fixed; width: 100%; }
    #tblPublicHistory td,
    #tblPublicHistory th { overflow: hidden; text-overflow: ellipsis; }
}

/* Hide inline action buttons on mobile (bottom bar takes over) */
@media (max-width: 767px) {
    .fc-desktop-actions { display: none !important; }
}
