/* Coupon Management System - application styles.
   Bootstrap 5 does the heavy lifting; this file only adds what the product needs. */

:root {
    --cms-card-radius: .65rem;
}

body { min-height: 100vh; }

.card { border-radius: var(--cms-card-radius); }

/* ---- KPI tiles used on all three dashboards ---- */
.kpi {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--cms-card-radius);
    background: #fff;
    padding: 1rem 1.15rem;
    height: 100%;
}
.kpi .kpi-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--bs-secondary-color);
}
.kpi .kpi-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.kpi.kpi-primary { border-left: 4px solid var(--bs-primary); }
.kpi.kpi-success { border-left: 4px solid var(--bs-success); }
.kpi.kpi-warning { border-left: 4px solid var(--bs-warning); }
.kpi.kpi-danger  { border-left: 4px solid var(--bs-danger); }
.kpi.kpi-info    { border-left: 4px solid var(--bs-info); }

/* ---- pure CSS bar chart, so no charting library is needed ---- */
.mini-chart { display: flex; align-items: flex-end; gap: .35rem; height: 140px; }
.mini-chart .bar-wrap { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.mini-chart .bar {
    background: linear-gradient(180deg, var(--bs-primary) 0%, #6ea8fe 100%);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
}
.mini-chart .bar-label { font-size: .65rem; text-align: center; color: var(--bs-secondary-color); margin-top: .25rem; }

/* ---- scratch card ---- */
.scratch-wrap {
    position: relative;
    width: 320px;
    max-width: 100%;
    height: 200px;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.scratch-prize {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    color: #fff;
    text-align: center;
    padding: 1rem;
}
.scratch-prize .prize-amount { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.scratch-prize .prize-code {
    margin-top: .6rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.15rem;
    letter-spacing: .12em;
    background: rgba(255,255,255,.18);
    border-radius: 6px;
    padding: .3rem .6rem;
}
#scratchCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: grab;
    touch-action: none;
}
.scratch-hint { font-size: .85rem; color: var(--bs-secondary-color); }

/* ---- misc ---- */
.table-sticky thead th { position: sticky; top: 0; background: #fff; z-index: 2; }
.code-cell { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.filter-bar { background: #fff; border: 1px solid var(--bs-border-color); border-radius: var(--cms-card-radius); padding: 1rem; }
.required::after { content: " *"; color: var(--bs-danger); }

/* ---- Phase 2: manual reward cards -----------------------------------------
   The colour comes from an inline style driven by the shop's configured hex value.
   There is deliberately no class such as "reward-500": a CSS class that encodes the
   amount would leak it to anyone who opens the element inspector. */
.reward-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 1rem .75rem;
    background: #fff;
    border: 2px solid var(--bs-border-color);
    border-radius: var(--cms-card-radius);
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.reward-card:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.reward-card.selected { box-shadow: 0 0 0 3px rgba(13,110,253,.35); }
.reward-card.unavailable, .reward-card:disabled { opacity: .45; cursor: not-allowed; }

.reward-card .reward-swatch { width: 44px; height: 44px; border-radius: 50%; }
.reward-card .reward-name { font-weight: 600; font-size: .95rem; text-align: center; }
.reward-card .reward-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .7rem;
    letter-spacing: .08em;
    color: var(--bs-secondary-color);
}
.reward-card .reward-stock { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); }

.reward-swatch-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.15);
}
