/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --primary: #d64d8a;
    --primary-hover: #c4407a;
    --success: #34c759;
    --danger: #ff3b30;
    --info: #5ac8fa;
    --border: #e5e5ea;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ─── Navbar ─── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.nav-links { display: flex; gap: 8px; }

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-logout { color: var(--danger); }

/* ─── Container ─── */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ─── Page Header ─── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
}

.global-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ─── Stats Grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.stat-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

/* ─── Cards List ─── */
.cards-list { display: flex; flex-direction: column; gap: 12px; }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body { padding: 0 20px 12px; }

.card-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: #fafafa;
    flex-wrap: wrap;
}

/* ─── Badges ─── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: #e8f9ed; color: #1b8a3a; }
.badge-muted { background: #f0f0f0; color: #888; }
.badge-info { background: #e8f4fd; color: #1a7bb5; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    color: var(--text);
    background: var(--bg);
    gap: 6px;
}

.btn:hover { filter: brightness(0.95); }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--border); color: var(--text); }

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-full { width: 100%; }

/* ─── Forms ─── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(214, 77, 138, 0.12);
}

textarea { resize: vertical; }

input[type="file"] {
    font-size: 14px;
    padding: 8px 0;
}

/* ─── Table ─── */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fafafa;
}

.table td { font-size: 14px; }

.gender-select {
    width: auto;
    padding: 4px 8px;
    font-size: 13px;
    border-radius: 6px;
}

.gender-female { background: #fce4ec; border-color: #f48fb1; }
.gender-male { background: #e3f2fd; border-color: #90caf9; }
.gender-unknown { background: #f5f5f5; border-color: #e0e0e0; }

/* ─── Panels ─── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 640px) {
    .content-grid { grid-template-columns: 1fr; }
}

.panel {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.panel h2 {
    font-size: 16px;
    margin-bottom: 8px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* ─── Compliments List ─── */
.compliments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.compliment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 12px;
}

.compliment-content { flex: 1; min-width: 0; }

.compliment-text {
    font-size: 14px;
    word-break: break-word;
}

.compliment-caption {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.compliment-image img {
    max-width: 80px;
    max-height: 60px;
    border-radius: 6px;
    object-fit: cover;
}

.compliment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Image Preview ─── */
.image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 8px;
}

/* ─── Result Messages ─── */
.result-msg {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 500;
    min-height: 20px;
}

.result-success { color: var(--success); }
.result-error { color: var(--danger); }

/* ─── Modal ─── */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    width: 90%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 16px; }

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 4px;
}

.modal-body { padding: 20px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

/* ─── Utilities ─── */
.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-size: 14px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert-error {
    background: #ffeaea;
    color: var(--danger);
}

.bulk-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ─── Login ─── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #fce4ec 0%, #f3e5f5 50%, #e8eaf6 100%);
}

.login-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-icon { font-size: 48px; display: block; margin-bottom: 12px; }

.login-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}
