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

:root {
    --bg:          #f4f5f7;
    --surface:     #ffffff;
    --surface2:    #f0f1f4;
    --border:      #e2e4ea;
    --accent:      #FDB749;
    --accent-dark: #e8a030;
    --accent2:     #e8622a;
    --gray:        #CDCDCD;
    --text:        #1e2130;
    --text-muted:  #7a7f99;
    --green:       #2ecc8f;
    --red:         #e8622a;
    --radius:      10px;
    --font:        'Nunito', sans-serif;
    --font-body:   'Nunito Sans', sans-serif;
    --shadow:      0 2px 8px rgba(0,0,0,.07);
    --shadow-md:   0 4px 16px rgba(0,0,0,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

/* ---- NAV ---- */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0;
    height: 62px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    margin-right: 2rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.nav-brand img {
    height: 36px;
    width: auto;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    padding: .4rem .9rem;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    transition: color .15s, background .15s;
    font-family: var(--font);
}
nav a:hover, nav a.active {
    color: var(--text);
    background: var(--surface2);
}
nav a.active {
    color: var(--accent-dark);
}

/* ---- LAYOUT ---- */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

h1 {
    font-family: var(--font);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}
h2 {
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

/* ---- CARD ---- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* ---- FORMS ---- */
label {
    display: block;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .35rem;
    font-weight: 600;
    font-family: var(--font);
}

input, select {
    width: 100%;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: .6rem .85rem;
    font-family: var(--font-body);
    font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
    margin-bottom: 1rem;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(253,183,73,.15);
}
input[type="file"] { padding: .5rem; cursor: pointer; background: var(--surface2); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.2rem;
    border-radius: 6px;
    border: none;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s, transform .1s, box-shadow .15s;
    letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }
.btn:hover  { opacity: .88; }

.btn-primary  { background: var(--accent);  color: var(--text); box-shadow: 0 2px 8px rgba(253,183,73,.35); }
.btn-primary:hover { background: var(--accent-dark); opacity:1; }
.btn-success  { background: var(--green);   color: #fff; }
.btn-warning  { background: var(--accent2); color: #fff; }
.btn-ghost    { background: var(--surface2); color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); opacity:1; }
.btn-danger   { background: #fdecea; color: #c0392b; border: 1.5px solid #f5c6c2; }
.btn-wa       { background: #25D366; color: #fff; }
.btn-sm       { padding: .3rem .75rem; font-size: .82rem; }

.btn-group { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---- TABLE ---- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
th {
    text-align: left;
    padding: .65rem .85rem;
    background: var(--surface2);
    color: var(--text-muted);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 2px solid var(--border);
    font-family: var(--font);
}
td {
    padding: .65rem .85rem;
    border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fffbf2; }

/* ---- CODE / BADGE ---- */
.code {
    font-family: 'Courier New', monospace;
    font-size: .85rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: .1rem .45rem;
    border-radius: 4px;
    color: var(--accent-dark);
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: .15rem .65rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    font-family: var(--font);
}
.badge-female { background: #fdf0f8; color: #c2609e; border: 1px solid #f0cce6; }
.badge-male   { background: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }
.badge-ok     { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-pending{ background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }

/* ---- ALERTS ---- */
.alert {
    padding: .85rem 1.1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: .9rem;
    font-weight: 500;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---- MATCH CARD ---- */
.match-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}
.match-card:hover { box-shadow: var(--shadow-md); }
.match-person { text-align: center; }
.match-person .name { font-weight: 700; font-size: 1rem; font-family: var(--font); }
.match-person .code { margin-bottom: .3rem; }
.match-heart {
    font-size: 1.6rem;
    text-align: center;
}
.match-actions {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-top: .8rem;
}

/* ---- CHOICES FORM ---- */
.person-lookup {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: start;
}
.person-confirm {
    background: #fffbf2;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    padding: .8rem 1rem;
    margin-bottom: 1rem;
}
.person-confirm .name { font-weight: 700; color: var(--accent-dark); font-family: var(--font); }

/* ---- PROGRESS ---- */
.progress-wrap {
    background: var(--surface2);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
    margin: .5rem 0;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width .3s;
    border-radius: 6px;
}
.log-line {
    font-family: 'Courier New', monospace;
    font-size: .82rem;
    padding: .25rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
.log-line.ok    { color: #059669; }
.log-line.error { color: #dc2626; }

/* ---- UTILS ---- */
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ---- FOOTER ---- */
footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 1.2rem 2rem;
    margin-top: 3rem;
    text-align: center;
}
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .6rem;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: .3rem .8rem;
    border-radius: 6px;
    font-size: .85rem;
    font-weight: 600;
    font-family: var(--font);
    transition: color .15s, background .15s;
}
.footer-links a:hover {
    color: var(--text);
    background: var(--surface2);
}
.footer-copy {
    font-size: .78rem;
    color: var(--gray);
}

@media (max-width: 640px) {
    .form-row, .form-row.three { grid-template-columns: 1fr; }
    .match-card { grid-template-columns: 1fr; text-align: center; }
    .person-lookup { grid-template-columns: 1fr; }
    nav { padding: 0 1rem; }
    nav a { padding: .3rem .6rem; font-size: .82rem; }
}
