/* Staff Portal CSS - Professional Design */
/* Font now loaded via navbar.css (Poppins) */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #64748b;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-muted: #64748b;
    --nav-bg: #1e293b;
    --nav-hover: #334155;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── NAVBAR ── */
.staff-portal { min-height: 100vh; display: flex; flex-direction: column; }

.navbar {
    background-color: var(--nav-bg);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    height: 64px;
}

.nav-brand h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.3px;
}

.nav-brand h1 span { color: #60a5fa; }

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    gap: 5px;
    padding: 4px;
}

.hamburger span {
    width: 24px; height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(7px, 7px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

.nav-menu { display: flex; align-items: center; gap: 0.25rem; }

.nav-menu a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-menu a:hover { background-color: var(--nav-hover); color: white; }
.nav-menu a.active { background-color: var(--primary); color: white; }

.nav-alerts { position: relative; }

.alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ── CONTENT ── */
.content-area {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ── LOGIN ── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    padding: 1rem;
}

.login-box {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 420px;
}

.login-box h1 { color: var(--primary); margin-bottom: 0.5rem; text-align: center; font-size: 1.75rem; font-weight: 700; }
.login-box h2 { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 2rem; text-align: center; font-weight: 400; }
.disclaimer { margin-top: 1.5rem; font-size: 0.75rem; color: var(--text-muted); text-align: center; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.help-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.error { color: var(--danger); font-size: 0.75rem; margin-top: 0.25rem; }

/* ── BUTTONS ── */
.btn {
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
    text-align: center;
    min-height: 40px;
    line-height: 1;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); }
.btn-secondary { background-color: var(--secondary); color: white; }
.btn-secondary:hover { background-color: #475569; }
.btn-success { background-color: var(--success); color: white; }
.btn-warning { background-color: var(--warning); color: white; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.form-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ── ALERTS ── */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    border-left: 4px solid transparent;
}

.alert-success { background: #f0fdf4; color: #166534; border-color: var(--success); }
.alert-warning { background: #fffbeb; color: #92400e; border-color: var(--warning); }
.alert-error, .alert-danger { background: #fef2f2; color: #991b1b; border-color: var(--danger); }
.alert-info { background: var(--primary-light); color: #1e40af; border-color: var(--primary); }

.alert-urgent {
    background: #fef2f2;
    border: 2px solid var(--danger);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ── DASHBOARD ── */
.dashboard h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text); }
.dashboard h3 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 1rem; color: var(--text); }

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.role-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ── CARDS ── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

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

.card-header h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.25rem; }

/* ── TABLE ── */
.table-container {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead tr { background: var(--nav-bg); }
.table thead th { padding: 0.875rem 1rem; text-align: left; color: #cbd5e1; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.table tbody td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }

.table a { color: var(--primary); text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }

/* ── PROFILE SECTIONS ── */
.profile-section {
    background: var(--surface);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.profile-section h3 { margin-top: 0; margin-bottom: 1rem; color: var(--text); font-size: 1rem; font-weight: 600; }
.actions { margin-top: 1rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ── TIMELINE ── */
.timeline { margin-top: 1.5rem; }

.timeline-item {
    background: var(--surface);
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow);
}

.timeline-date { font-weight: 600; color: var(--primary); margin-bottom: 0.5rem; font-size: 0.875rem; }
.timeline-content h4 { margin-bottom: 0.5rem; font-size: 0.95rem; }
.timeline-incident { border-left-color: var(--danger); }
.timeline-mood_checkin { border-left-color: var(--warning); }
.timeline-achievement { border-left-color: var(--success); }

/* ── PRIORITY BADGES ── */
.priority-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.priority-badge.priority-high, .priority-high { background: #fef2f2; color: var(--danger); }
.priority-badge.priority-medium, .priority-medium { background: #fffbeb; color: var(--warning); }
.priority-badge.priority-low, .priority-low { background: #f0fdf4; color: var(--success); }

/* ── MOOD ── */
.mood-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.mood-table th { background: var(--bg); padding: 0.75rem; text-align: left; border-bottom: 2px solid var(--border); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); }
.mood-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.875rem; }

.mood-level-5 { color: var(--success); font-weight: 600; }
.mood-level-4 { color: #16a34a; font-weight: 600; }
.mood-level-3 { color: var(--warning); font-weight: 600; }
.mood-level-2 { color: #ea580c; font-weight: 600; }
.mood-level-1 { color: var(--danger); font-weight: 600; }

/* ── MISC ── */
.achievement-list, .wishes-list { list-style: none; padding: 0; }
.achievement-list li, .wishes-list li { padding: 0.75rem 1rem; margin-bottom: 0.5rem; background: var(--bg); border-radius: 8px; border-left: 3px solid var(--primary); font-size: 0.875rem; }

.no-alerts { background: #f0fdf4; padding: 2rem; border-radius: var(--radius); text-align: center; color: #166534; }

.message-request-banner { background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%); color: white; padding: 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; }
.message-request-banner h3 { margin: 0 0 0.5rem; color: white; }

.source-info-box { background: var(--bg); padding: 1.25rem; border-radius: var(--radius); margin-top: 1.25rem; border-left: 3px solid var(--primary); }
.reason-box { background: white; padding: 1rem; border-radius: 8px; border: 1px solid var(--border); margin: 0.75rem 0; font-style: italic; line-height: 1.6; }

.badge-message { background: #0891b2; color: white; padding: 0.25rem 0.6rem; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.message-request-row { background: var(--primary-light) !important; }

.staff-comment { color: var(--text-muted); font-size: 0.875rem; }

/* ── MOBILE ── */
@media (max-width: 767px) {
    .navbar { padding: 0 1rem; }
    .nav-brand h1 { font-size: 1rem; }

    .hamburger { display: flex; }

    .nav-menu {
        position: fixed;
        top: 64px; left: 0; right: 0;
        flex-direction: column;
        background: var(--nav-bg);
        border-top: 1px solid #334155;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        gap: 0;
        z-index: 99;
    }

    .nav-menu.active { max-height: 600px; }

    .nav-menu a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #334155;
        border-radius: 0;
        font-size: 0.95rem;
        white-space: normal;
        display: block;
        width: 100%;
    }

    .nav-menu a:last-child { border-bottom: none; }

    .content-area { padding: 1rem; }

    .dashboard h2 { font-size: 1.4rem; }
    .dashboard-header { flex-direction: column; align-items: flex-start; }

    .form-actions { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }

    .table-container { margin: 0 -1rem; border-radius: 0; border-left: none; border-right: none; }

    .profile-section { padding: 1rem; }
    .actions { flex-direction: column; }

    .alert { font-size: 0.875rem; }
}

/* ── PRINT ── */
@media print {
    .navbar, .form-actions, .hamburger { display: none !important; }
    .content-area { padding: 0; max-width: none; }
}
