:root {
    --rose-dark: #8C1549;
    --rose-mid:  #C72F6E;
    --rose-soft: #FFE4EB;
    --rose-bg:   #FFF0F4;
    --rose-line: #E8A0B8;
    --text:      #3A1020;
    --green:     #1f9d55;
    --gray:      #6c757d;
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(180deg, var(--rose-soft) 0%, var(--rose-bg) 100%);
    color: var(--text);
    min-height: 100vh;
}

.navbar {
    background: linear-gradient(90deg, var(--rose-dark), var(--rose-mid));
    color: #fff;
    padding: 14px 24px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 4px 12px rgba(140,21,73,0.18);
    flex-wrap: wrap; gap: 10px;
}
.navbar .brand { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.navbar .brand small { font-weight: 400; opacity: 0.85; font-size: 12px; display: block; }
.navbar .actions a, .navbar .actions button {
    color: #fff; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
    padding: 8px 14px; border-radius: 8px; text-decoration: none; font-size: 14px;
    margin-left: 6px; cursor: pointer; transition: background 0.2s;
}
.navbar .actions a:hover, .navbar .actions button:hover { background: rgba(255,255,255,0.28); }

main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(140,21,73,0.10);
    padding: 22px;
    margin-bottom: 18px;
    border: 1px solid #f3d2dd;
}

h1, h2, h3 { color: var(--rose-dark); margin-top: 0; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.stat {
    background: #fff; border-radius: 12px; padding: 16px;
    border-left: 5px solid var(--rose-mid);
    box-shadow: 0 4px 12px rgba(140,21,73,0.08);
}
.stat .label { font-size: 12px; text-transform: uppercase; color: var(--gray); letter-spacing: 1px; }
.stat .value { font-size: 28px; font-weight: 700; color: var(--rose-dark); margin-top: 4px; }
.stat.green { border-left-color: var(--green); }
.stat.green .value { color: var(--green); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=search] {
    flex: 1; min-width: 240px;
    padding: 10px 14px;
    border: 1px solid var(--rose-line);
    border-radius: 10px; font-size: 15px; background: #fff;
}
.toolbar input[type=search]:focus { outline: 2px solid var(--rose-mid); }

.btn {
    background: var(--rose-mid); color: #fff; border: none;
    padding: 10px 18px; border-radius: 10px; cursor: pointer; font-size: 14px;
    text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.2s;
}
.btn:hover { background: var(--rose-dark); transform: translateY(-1px); }
.btn.secondary { background: #fff; color: var(--rose-dark); border: 1px solid var(--rose-line); }
.btn.secondary:hover { background: var(--rose-soft); }
.btn.danger { background: #c0392b; }
.btn.danger:hover { background: #962c20; }
.btn.green { background: var(--green); }
.btn.green:hover { background: #167a3d; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

table {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 10px; overflow: hidden;
}
table thead th {
    background: var(--rose-dark); color: #fff; text-align: left;
    padding: 12px 10px; font-size: 13px; letter-spacing: 0.5px;
}
table tbody td { padding: 10px; border-top: 1px solid #f3d2dd; font-size: 14px; }
table tbody tr:hover { background: var(--rose-soft); }
table tbody tr.attended { background: #e8f7ed; }
table tbody tr.attended:hover { background: #d3eedd; }
table tbody tr.added-new td { background: #fff5e6; }

.badge {
    display: inline-block; padding: 3px 9px; border-radius: 99px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
}
.badge.ok { background: #d2f4dd; color: #1b5e36; }
.badge.pending { background: #ffe5b4; color: #7d4a00; }
.badge.new { background: #ffd9d9; color: #802; }
.badge.qr { background: #d9eaff; color: #243d77; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; color: var(--rose-dark); }
.form-group input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--rose-line);
    border-radius: 8px; font-size: 15px;
}
.form-group input:focus { outline: 2px solid var(--rose-mid); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }
.alert.error { background: #fde2e2; color: #802; border-left: 4px solid #c0392b; }
.alert.success { background: #d2f4dd; color: #1b5e36; border-left: 4px solid var(--green); }

/* Login */
.login-page {
    min-height: 100vh; display: flex; justify-content: center; align-items: center;
    background: linear-gradient(135deg, #FFE4EB, #FFC0D5);
}
.login-box {
    background: #fff; padding: 32px; border-radius: 16px;
    box-shadow: 0 14px 40px rgba(140,21,73,0.22);
    width: 360px; max-width: 92%;
}
.login-box h1 { text-align: center; font-family: 'Great Vibes', cursive; font-size: 44px; margin-bottom: 8px; }
.login-box .sub { text-align: center; color: var(--gray); font-size: 13px; margin-bottom: 22px; }

/* Modal */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.45);
    display: none; justify-content: center; align-items: center; z-index: 100;
}
.modal-backdrop.show { display: flex; }
.modal-box {
    background: #fff; border-radius: 14px; padding: 24px; width: 420px; max-width: 92%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@media (max-width: 600px) {
    .navbar { flex-direction: column; align-items: flex-start; }
    table thead { display: none; }
    table tbody td { display: block; padding: 6px 10px; }
    table tbody tr { display: block; padding: 10px; border-top: 1px solid #f3d2dd; }
    .toolbar { flex-direction: column; align-items: stretch; }
}
