@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@600;700&family=Work+Sans:wght@400;500;600;700&display=swap');

/* ============================================================
   Navasakthi Kamakshi Temple — design tokens
   Palette drawn from kumkum, turmeric, and sandalwood — the
   materials actually used at the counter, not a generic brand kit.
   ============================================================ */
:root {
    --maroon: #7A1F2B;       /* kumkum red — primary */
    --maroon-dark: #5C1620;
    --gold: #C99A2E;         /* turmeric/gold — accent */
    --gold-light: #E9C873;
    --cream: #FBF4E6;        /* sandalwood — page background */
    --cream-deep: #F2E6CC;
    --ink: #2B211C;          /* charcoal ink — text */
    --ink-muted: #6E6154;
    --leaf: #57734A;         /* banana leaf green — success */
    --leaf-bg: #E7EEE1;
    --danger: #A33B2E;
    --danger-bg: #F6E3DF;
    --border: #E3D6BC;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(43, 33, 28, 0.08);
    --font-display: 'Cormorant', Georgia, serif;
    --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--maroon); }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--maroon-dark);
    margin: 0 0 8px;
}
h1 { font-size: 30px; }
h2 { font-size: 22px; }

.muted { color: var(--ink-muted); font-size: 14px; }

/* ---------- Gopuram signature motif ---------- */
/* A restrained silhouette used once, at the top of key screens —
   the single distinctive mark rather than decoration everywhere. */
.gopuram-band {
    height: 6px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold) 0px, var(--gold) 14px,
        var(--maroon) 14px, var(--maroon) 28px
    );
}

/* ---------- Top bar ---------- */
.topbar {
    background: var(--maroon);
    color: var(--cream);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: var(--shadow);
}
.topbar h1 {
    color: var(--cream);
    font-size: 19px;
    margin: 0;
    line-height: 1.2;
}
.topbar .subtitle {
    font-size: 12px;
    color: var(--gold-light);
    display: block;
}
.topbar-spacer { flex: 1; }
.topbar a.staff-name {
    color: var(--cream);
    font-size: 13px;
    text-decoration: none;
    opacity: 0.9;
}

.page-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 18px 16px 90px;
}

/* ---------- Auth pages (login/setup) ---------- */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.auth-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
}
.brand-mark { margin-bottom: 12px; }

/* ---------- Forms ---------- */
.stacked-form { text-align: left; margin-top: 18px; }
.stacked-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-muted);
    margin-bottom: 14px;
}
.stacked-form input,
.stacked-form select,
.stacked-form textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 12px;
    font-size: 16px; /* prevents iOS zoom-on-focus */
    font-family: var(--font-body);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--cream);
    color: var(--ink);
}
.stacked-form input:focus,
.stacked-form select:focus,
.stacked-form textarea:focus {
    outline: 2px solid var(--gold);
    outline-offset: 1px;
    border-color: var(--gold);
}
.stacked-form textarea { min-height: 90px; resize: vertical; }

.radio-row {
    display: flex;
    gap: 10px;
}
.radio-row label {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 0;
}
.radio-row input[type="radio"] { width: auto; display: inline; margin-right: 6px; }
.radio-row input[type="radio"]:checked + span { font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    padding: 13px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-outline { background: transparent; color: var(--maroon); border: 1px solid var(--maroon); }
.btn-block { display: block; width: 100%; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* Floating primary action — thumb-reachable on a phone at the counter */
.fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: var(--maroon);
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(90, 22, 32, 0.4);
    line-height: 1;
}

/* ---------- Item cards ---------- */
.item-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.item-card {
    display: flex;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    align-items: center;
}
.item-card img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--cream-deep);
    flex-shrink: 0;
}
.item-card .no-photo {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    background: var(--cream-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 22px;
    flex-shrink: 0;
}
.item-card .item-info { flex: 1; min-width: 0; }
.item-card .item-info h3 {
    font-size: 16px;
    margin: 0 0 3px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-card .price { color: var(--maroon); font-weight: 700; font-size: 14px; }
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
}
.badge-service { background: var(--leaf-bg); color: var(--leaf); }
.badge-product { background: var(--cream-deep); color: var(--gold); border: 1px solid var(--gold); }
.badge-out { background: var(--danger-bg); color: var(--danger); }
.badge-inactive { background: #eee; color: #888; }

/* ---------- Tabs / filters ---------- */
.tabs { display: flex; gap: 8px; margin-top: 14px; }
.tabs a {
    padding: 8px 16px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.tabs a.active { background: var(--maroon); color: #fff; border-color: var(--maroon); }

/* ---------- Photo capture ---------- */
.photo-picker {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    padding: 20px;
    cursor: pointer;
    background: #fff;
}
.photo-picker img.preview {
    max-width: 100%;
    max-height: 220px;
    border-radius: 8px;
    display: block;
    margin: 0 auto 10px;
}
.photo-picker .placeholder {
    color: var(--ink-muted);
    font-size: 14px;
}
.photo-picker .placeholder .icon { font-size: 32px; display: block; margin-bottom: 6px; }

/* ---------- Messages ---------- */
.flash {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}
.flash-success { background: var(--leaf-bg); color: var(--leaf); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.error-box {
    background: var(--danger-bg);
    color: var(--danger);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
}
.warning-box {
    background: var(--cream-deep);
    color: var(--ink-muted);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 16px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--ink-muted);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

@media (min-width: 640px) {
    .auth-card { padding: 40px 36px; }
}
