/* ════════════════════════════════════════════════════════════
   GreenHat — Dashboard Styles (Admin + User)
   ════════════════════════════════════════════════════════════ */

/* ─── Shared ─────────────────────────────────────────────── */

.dashboard-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.dashboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.dashboard-tab {
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    bottom: -2px;
    border-bottom: 2px solid transparent;
}

.dashboard-tab:hover {
    color: var(--primary);
    background: rgba(46, 204, 113, 0.06);
}

.dashboard-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(46, 204, 113, 0.06);
    font-weight: 600;
}

.tab-count {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.tab-count-alert {
    background: #e74c3c;
    animation: pulse-badge 2s infinite;
}

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

.dashboard-content {
    display: none;
}

.dashboard-content.active {
    display: block;
    animation: fadeIn 0.35s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Shared Components ──────────────────────────────────── */

.card-glass {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 14px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}

.card-glass:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-label i {
    color: var(--primary);
    font-size: 0.85rem;
}

.required { color: #e74c3c; }
.optional  { color: var(--text-light); font-size: 0.8rem; font-weight: 400; }

.form-group { margin-bottom: 1.25rem; }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.12);
}

.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

.form-hint {
    color: var(--text-light);
    font-size: 0.78rem;
    margin-top: 0.35rem;
    display: block;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}
.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.35;
}
.empty-state h3 { margin-bottom: 0.5rem; color: var(--text); }

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

/* ─── Admin Dashboard ────────────────────────────────────── */

.admin-dash-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(46,204,113,0.08) 0%, rgba(39,174,96,0.04) 100%);
    border-color: rgba(46,204,113,0.2);
}

.admin-dash-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.admin-dash-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
}

.admin-online-dot {
    position: absolute;
    bottom: 2px; right: 2px;
    width: 14px; height: 14px;
    background: #43b581;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}

.admin-dash-info h2 { font-size: 1.5rem; color: var(--primary); margin-bottom: 0.25rem; }
.admin-dash-info p  { color: var(--text-light); }

.admin-badge-inline {
    display: inline-block;
    background: #f39c12;
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    vertical-align: middle;
    margin-left: 0.4rem;
}

/* Stat cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-card i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: block;
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
    color: var(--text);
    font-weight: 700;
}

.stat-card p { color: var(--text-light); font-size: 0.85rem; }

.stat-card.severity-high h3 { color: #e74c3c; }
.stat-card.severity-high i  { color: #e74c3c; }

.stat-card.stat-card-alert {
    border-color: rgba(231,76,60,0.3);
    background: rgba(231,76,60,0.04);
}
.stat-card.stat-card-alert h3 { color: #e74c3c; }
.stat-card.stat-card-alert i  { color: #e74c3c; }

/* Severity badges */
.severity-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}
.severity-1 { background: rgba(46,204,113,.15); color: #27ae60; }
.severity-2 { background: rgba(243,156,18,.15); color: #e67e22; }
.severity-3 { background: rgba(230,126,34,.15); color: #d35400; }
.severity-4 { background: rgba(231,76,60,.15);  color: #c0392b; }
.severity-5 { background: rgba(146,43,33,.25);  color: #922b21; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th {
    text-align: left;
    padding: 0.7rem 0.9rem;
    background: rgba(46,204,113,0.06);
    color: var(--text-light);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.data-table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(46,204,113,0.03); }

.table-responsive { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }

/* Buttons */
.btn {
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
}

.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; transform: translateY(-1px); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-success { background: rgba(46,204,113,0.15); color: #27ae60; }
.btn-success:hover { background: #2ecc71; color: white; }

.btn-icon {
    padding: 0.4rem 0.6rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.2s;
}
.btn-danger-sm { background: rgba(231,76,60,.12); color: #e74c3c; border: 1px solid rgba(231,76,60,.2); }
.btn-danger-sm:hover { background: rgba(231,76,60,.3); }

/* Dashboard form (admin) */
.dashboard-form {
    margin-bottom: 2rem;
}
.dashboard-form h3 {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    color: var(--text);
}

/* Reports (admin) */
.reports-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-btn:hover { border-color: var(--primary); color: var(--primary); }

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.report-card { }
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.report-status {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.status-pending  { background: rgba(243,156,18,.12); color: #e67e22; }
.status-approved { background: rgba(46,204,113,.12); color: #27ae60; }
.status-rejected { background: rgba(231,76,60,.12);  color: #c0392b; }

.report-date { font-size: 0.78rem; color: var(--text-light); display: flex; align-items: center; gap: 0.3rem; }
.report-body p { margin: 0.3rem 0; font-size: 0.9rem; }
.report-body a { color: var(--primary); text-decoration: none; font-weight: 500; }
.report-body a:hover { text-decoration: underline; }
.report-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* Charts */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-container h3.chart-title { font-size: 1rem; margin-bottom: 1rem; color: var(--text); }

/* ─── User Dashboard ─────────────────────────────────────── */

/* Profile card */
.user-profile-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(46,204,113,0.06) 0%, rgba(52,152,219,0.04) 100%);
    border-color: rgba(46,204,113,0.15);
    flex-wrap: wrap;
}

.user-profile-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-profile-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.user-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    object-fit: cover;
    display: block;
}

.user-profile-status {
    position: absolute;
    bottom: 3px; right: 3px;
    width: 16px; height: 16px;
    background: #43b581;
    border-radius: 50%;
    border: 2.5px solid var(--card-bg);
}

.user-profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.user-profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(88,101,242,0.1);
    color: #5865F2;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.user-profile-id {
    font-size: 0.82rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.user-profile-id code {
    background: var(--background);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--border);
}

.user-profile-right {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.user-mini-stat {
    text-align: center;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    min-width: 80px;
}

.user-mini-stat-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.user-mini-stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.text-warning { color: #e67e22 !important; }
.text-success { color: #27ae60 !important; }

/* Report form (user) */
.user-report-form {
    max-width: 680px;
}

.form-section-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.form-section-icon {
    width: 44px;
    height: 44px;
    background: rgba(231,76,60,0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #e74c3c;
    flex-shrink: 0;
}

.form-section-header h3 {
    font-size: 1.15rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.form-section-header p {
    color: var(--text-light);
    font-size: 0.88rem;
}

.form-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(52,152,219,0.06);
    border: 1px solid rgba(52,152,219,0.15);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.5rem;
}
.form-notice i { color: #3498db; margin-top: 0.1rem; flex-shrink: 0; }
.form-notice p { font-size: 0.84rem; color: var(--text-light); margin: 0; }

.btn-submit-report {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.btn-submit-report:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.3);
}

.btn-submit-report:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* User report history cards */
.user-report-card { }

.user-report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.report-status-badge {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.report-card-date {
    font-size: 0.78rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.user-report-card-body { }

.report-target {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
    margin-bottom: 0.6rem;
    color: var(--text-light);
}
.report-target i { color: var(--primary); }
.report-target span { font-weight: 600; color: var(--text); }
.report-target code {
    background: var(--background);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

.report-reason-text {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.report-proof-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}
.report-proof-link:hover { text-decoration: underline; }

.btn-go-report {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background: rgba(46,204,113,0.1);
    color: var(--primary);
    border: 1.5px solid rgba(46,204,113,0.25);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: 0.2s;
    font-size: 0.9rem;
}
.btn-go-report:hover { background: var(--primary); color: white; }

/* Responsive */
@media (max-width: 768px) {
    .dashboard-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .user-profile-card { flex-direction: column; align-items: flex-start; }
    .user-profile-right { justify-content: flex-start; }
    .reports-grid { grid-template-columns: 1fr; }
    .data-table { font-size: 0.82rem; }
}
