/* Royal Barbershop — shared styles */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Playfair+Display:wght@600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --ink:       #14110f;
    --paper:     #f5efe4;
    --paper-2:   #eae0cf;
    --gold:      #b58a3b;
    --gold-2:    #d9ad55;
    --burgundy:  #6b1f2a;
    --muted:     #7a6f60;
    --line:      #2a221e;
    --ok:        #1f7a4a;
    --warn:      #b4411d;
    --shadow:    0 1px 0 rgba(0,0,0,.04), 0 18px 40px -24px rgba(20,17,15,.35);
    --radius:    2px;
    --display:   'Playfair Display', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --display-2: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    --body:      'Inter', -apple-system, BlinkMacSystemFont, system-ui, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    background:
        radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(181,138,59,.12), transparent 60%),
        repeating-linear-gradient(45deg, transparent 0 12px, rgba(20,17,15,.015) 12px 13px),
        var(--paper);
    min-height: 100vh;
}

/* ----- Typography ----- */
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; }
h2 { font-size: 1.6rem; line-height: 1.2; }
h3 { font-size: 1.15rem; }
p  { line-height: 1.55; color: #2b2520; }

.eyebrow {
    font-family: var(--body);
    font-size: .72rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
}

/* ----- Layout shell ----- */
.shell {
    max-width: 520px;
    margin: 0 auto;
    padding: 32px 22px 56px;
}
.shell-wide {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 24px 56px;
}

/* ----- Header / crest ----- */
.crest {
    text-align: center;
    padding: 18px 0 22px;
    border-bottom: 1px solid rgba(20,17,15,.12);
    margin-bottom: 28px;
}
.crest .mono {
    display: inline-block;
    font-family: var(--display);
    font-style: italic;
    font-size: .95rem;
    color: var(--muted);
    letter-spacing: .04em;
}
.crest h1 { margin-top: 6px; letter-spacing: .02em; }
.crest h1.logo-heading {
    position: relative;
    margin: 8px auto 0;
    padding: 18px 0;
    display: block;
}
/* Soft gold halo behind the logo — gives the crest a premium "lit emblem" feel */
.crest h1.logo-heading::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 180px;
    max-width: 80%;
    background:
        radial-gradient(ellipse at center,
            rgba(217, 173, 85, 0.38) 0%,
            rgba(181, 138, 59, 0.22) 28%,
            rgba(181, 138, 59, 0.10) 50%,
            transparent 72%);
    z-index: 0;
    pointer-events: none;
    filter: blur(0.5px);
}
.crest h1.logo-heading img {
    position: relative;
    z-index: 1;
    display: block;
    margin: 0 auto;
    width: 140px;
    max-width: 42%;
    height: auto;
    filter:
        drop-shadow(0 0.5px 0 rgba(255, 252, 240, 0.85))
        drop-shadow(0 1.5px 2.5px rgba(20, 17, 15, 0.22))
        drop-shadow(0 0 0.5px rgba(181, 138, 59, 0.5));
}
.crest .rule {
    width: 42px; height: 1px; background: var(--gold);
    margin: 12px auto 0;
}
/* Smaller logo for the admin topbar */
.topbar .brand-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-decoration: none;
    color: var(--ink);
}
.topbar .brand-logo small {
    font-family: var(--body);
    font-size: .65rem;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
}
.topbar .brand-logo img {
    height: 44px;
    width: auto;
    display: block;
}
/* Logo on the dark discount pass */
.pass-logo {
    text-align: center;
    margin-bottom: 16px;
}
.pass-logo img {
    width: 110px;
    max-width: 55%;
    height: auto;
    display: inline-block;
    opacity: .95;
    /* Soft gold glow — gives depth on the dark pass, hides trace edges */
    filter:
        drop-shadow(0 0 6px rgba(217, 173, 85, 0.25))
        drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

/* ----- Card ----- */
.card {
    background: #fff;
    border: 1px solid rgba(20,17,15,.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
    position: relative;
}
.card::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(181,138,59,.25);
    border-radius: var(--radius);
    pointer-events: none;
}
.card > * { position: relative; }

/* ----- Forms ----- */
.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: .72rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="password"],
.field input[type="search"] {
    width: 100%;
    padding: 13px 14px;
    font-family: var(--body);
    font-size: 1rem;
    background: var(--paper);
    border: 1px solid rgba(20,17,15,.18);
    border-radius: var(--radius);
    color: var(--ink);
    transition: border-color .15s, background .15s;
}
.field input:focus {
    outline: none;
    border-color: var(--gold);
    background: #fff;
}

/* Radio group for days */
.days {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}
.days input[type="radio"] {
    position: absolute; opacity: 0; pointer-events: none;
}
.days label {
    display: block;
    text-align: center;
    padding: 14px 6px;
    background: var(--paper);
    border: 1px solid rgba(20,17,15,.18);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    letter-spacing: .06em;
    font-size: .82rem;
    text-transform: uppercase;
    color: var(--ink);
    transition: all .15s ease;
    margin: 0;
}
.days label small {
    display: block;
    font-weight: 400;
    font-size: .7rem;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    margin-top: 4px;
}
.days input[type="radio"]:checked + label {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.days input[type="radio"]:checked + label small { color: var(--gold-2); }

/* ----- Buttons ----- */
.btn {
    display: inline-block;
    padding: 14px 22px;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
    font-family: var(--body);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--radius);
    transition: transform .08s ease, background .2s;
    width: 100%;
}
.btn:hover { background: #000; }
.btn:active { transform: translateY(1px); }
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid rgba(20,17,15,.25);
}
.btn-ghost:hover { background: var(--paper); }
.btn-sm { padding: 8px 14px; font-size: .7rem; width: auto; }

/* ----- Alerts ----- */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: .9rem;
    border: 1px solid;
}
.alert-error { background: #fdecec; border-color: #f3bcbc; color: #7a1f1f; }
.alert-ok    { background: #eaf5ee; border-color: #bbd9c6; color: #1f5a3a; }

/* ----- Discount pass ----- */
.pass {
    background: linear-gradient(165deg, #1a1512 0%, #2a1f19 55%, #3a2a1f 100%);
    color: var(--paper);
    padding: 28px 26px;
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    box-shadow: 0 24px 50px -20px rgba(0,0,0,.5);
    border: 1px solid rgba(217,173,85,.3);
}
.pass::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(217,173,85,.35);
    border-radius: var(--radius);
    pointer-events: none;
}
.pass-head { display: flex; justify-content: space-between; align-items: flex-start; }
.pass-head .name {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
}
.pass-head .discount {
    font-family: var(--display);
    font-size: 3.4rem;
    font-weight: 800;
    color: var(--gold-2);
    line-height: 0.95;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(217, 173, 85, 0.25);
}
.pass-head .discount small {
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: 2px;
    letter-spacing: 0;
}
.pass-divider {
    margin: 22px -26px;
    border-top: 1px dashed rgba(217,173,85,.35);
    position: relative;
}
.pass-divider::before, .pass-divider::after {
    content: '';
    position: absolute;
    top: -10px;
    width: 20px; height: 20px;
    background: var(--paper);
    border-radius: 50%;
}
.pass-divider::before { left: -10px; }
.pass-divider::after  { right: -10px; }

.pass-row { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 10px; }
.pass-row .label {
    color: rgba(245,239,228,.55);
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .68rem;
    font-weight: 600;
}
.pass-row .val { font-weight: 500; text-align: right; }
.pass-row .val.pass-addr {
    color: var(--paper);
    text-decoration: none;
    border-bottom: 1px dotted rgba(217,173,85,.4);
    padding-bottom: 1px;
    line-height: 1.35;
}
.pass-row .val.pass-addr:hover { color: var(--gold-2); }

.pass-qr {
    background: var(--paper);
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 20px;
}
.pass-qr canvas, .pass-qr img { display: block; margin: 0 auto; }
.pass-qr .code {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 1.1rem;
    letter-spacing: .12em;
    color: var(--ink);
    font-weight: 600;
    margin-top: 10px;
}

/* ----- Dashboard ----- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(20,17,15,.12);
    margin-bottom: 28px;
}
.topbar .brand {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 600;
}
.topbar .brand small {
    display: block;
    font-family: var(--body);
    font-size: .65rem;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 600;
}
.topbar nav a {
    margin-left: 18px;
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}
.topbar nav a:hover, .topbar nav a.active { color: var(--ink); }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}
.stat {
    background: #fff;
    border: 1px solid rgba(20,17,15,.1);
    padding: 18px 20px;
    border-radius: var(--radius);
    position: relative;
}
.stat .label {
    font-size: .68rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}
.stat .value {
    font-family: var(--display);
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1.1;
    margin-top: 6px;
}
.stat .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.stat.accent { background: var(--ink); color: var(--paper); }
.stat.accent .label { color: rgba(245,239,228,.55); }
.stat.accent .value { color: var(--gold-2); }
.stat.accent .sub { color: rgba(245,239,228,.55); }

.panel {
    background: #fff;
    border: 1px solid rgba(20,17,15,.1);
    border-radius: var(--radius);
    margin-bottom: 22px;
    overflow: hidden;
}
.panel-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(20,17,15,.08);
}
.panel-head h2 { font-size: 1.2rem; }
.panel-body { padding: 18px 22px; }

/* Day breakdown bars */
.daybars { display: flex; flex-direction: column; gap: 14px; }
.daybar { display: grid; grid-template-columns: 140px 1fr 60px; align-items: center; gap: 14px; }
.daybar .day {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 600;
}
.daybar .day small {
    display: block;
    font-family: var(--body);
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
}
.daybar .bar-outer {
    height: 10px;
    background: var(--paper-2);
    border-radius: 999px;
    overflow: hidden;
}
.daybar .bar-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-2));
    border-radius: 999px;
    transition: width .8s ease;
}
.daybar .count { text-align: right; font-weight: 600; font-family: var(--display); font-size: 1.3rem; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th {
    text-align: left;
    font-size: .68rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(20,17,15,.12);
    background: var(--paper);
}
.tbl td {
    padding: 14px;
    border-bottom: 1px solid rgba(20,17,15,.06);
    vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(181,138,59,.04); }
.tbl .code {
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-weight: 600;
    letter-spacing: .06em;
}

.badge {
    display: inline-block;
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 2px;
    font-weight: 600;
}
.badge-active    { background: #eaf5ee; color: var(--ok); }
.badge-redeemed  { background: var(--paper-2); color: var(--muted); }
.badge-expired   { background: #fdecec; color: var(--warn); }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.filters input[type="search"] {
    max-width: 240px;
}
.filters .chip {
    padding: 7px 12px;
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: var(--paper);
    border: 1px solid rgba(20,17,15,.18);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
}
.filters .chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Utility */
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.small { font-size: .85rem; }

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}
.login-card { width: 100%; max-width: 380px; }

/* Print / screenshot guidance */
.tip {
    background: var(--paper-2);
    border-left: 3px solid var(--gold);
    padding: 12px 14px;
    font-size: .85rem;
    color: #3a3228;
    margin-top: 18px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

@media (max-width: 640px) {
    .daybar { grid-template-columns: 100px 1fr 40px; gap: 10px; }
    .tbl th, .tbl td { padding: 10px 8px; font-size: .85rem; }
    .topbar nav a { margin-left: 10px; font-size: .68rem; }
    .hide-sm { display: none; }
    .crest h1.logo-heading img {
        width: 105px;
        max-width: 32%;
    }
    .crest { padding: 14px 0 18px; margin-bottom: 22px; }
    .crest .mono { font-size: .82rem; }
    .topbar .brand-logo img { height: 36px; }
    .pass-logo img { width: 90px; }
}
@media (max-width: 380px) {
    .crest h1.logo-heading img {
        width: 90px;
        max-width: 30%;
    }
}

/* Subtle reveal on load */
@keyframes riseIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.card, .stat, .panel { animation: riseIn .5s ease both; }
.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }
