:root {
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Header & Nav */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.user-nav { display: flex; align-items: center; gap: 1rem; }
#user-info { font-size: 0.875rem; font-weight: 600; }

.tab-nav {
    display: flex;
    gap: 1rem;
    margin: 1.5rem auto;
}

.tab-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Overlay & Login */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card { width: 100%; max-width: 400px; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; font-weight: 600; }
.form-group input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-outline {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    border-radius: 0.375rem;
    cursor: pointer;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

/* Cards & Grid */
.card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.card h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Tables */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; padding: 0.75rem; background: var(--bg-color); color: var(--text-secondary); }
td { padding: 0.75rem; border-bottom: 1px solid var(--border-color); }

/* Stars */
.star-rating { display: flex; gap: 2px; }
.star { cursor: pointer; font-size: 1.25rem; color: #cbd5e1; transition: color 0.2s; }
.star:hover, .star.active { color: #f59e0b; }

/* Utilities */
.loading { color: var(--text-secondary); font-style: italic; }
.error-text { color: var(--danger-color); font-size: 0.875rem; margin-top: 0.5rem; }
.sync-status { font-size: 0.75rem; opacity: 0.8; }
.admin-only {
    display: none;
}

body.is-admin .admin-only {
    display: block;
}

body.is-admin button.admin-only {
    display: inline-block;
}

.success-text {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: inherit;
    background-color: white;
}


/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    margin: 5% auto;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.close-btn {
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-secondary);
}

.profile-section { margin-bottom: 1.5rem; }
.profile-section h3 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--primary-color); border-bottom: 1px dashed var(--border-color); padding-bottom: 0.25rem; }
.recap-box { 
    background: #eff6ff; 
    padding: 1.25rem; 
    border-radius: 0.5rem; 
    border-left: 4px solid var(--secondary-color); 
    font-size: 0.95rem; 
    white-space: pre-wrap;
    line-height: 1.6;
}
.social-links { display: flex; gap: 1rem; margin-top: 0.5rem; }
.social-links a { 
    background: var(--bg-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    color: var(--secondary-color); 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}
.history-item { 
    padding: 0.75rem; 
    border-bottom: 1px solid var(--border-color); 
    font-size: 0.875rem; 
    display: flex;
    justify-content: space-between;
}
.history-item:last-child { border-bottom: none; }
